nerobot

Forum Replies Created

Viewing 15 posts - 346 through 360 (of 805 total)
  • Author
    Posts
  • in reply to: Change color in a sprite #10335

    nerobot
    Participant

    Yes, colors mixes. To get clean custom color your source image should be white.

    in reply to: Extending Mojo3D #10332

    nerobot
    Participant

    Ok, try it in real project to know is it good enough.

    I think the new system works really well for the end user, since they never have to even know about the EntityBox class

    This time it’s FALSE:

    • you add public method GetComponentBox:EntityBox() to Entity
    • all your virtual OnStuff methods are inside of EntityBox – maybe you didn’t done with that part yet, I’m interested in how you will override them?
    in reply to: Change color in a sprite #10329

    nerobot
    Participant

    Also there is an Image.Color property.

    in reply to: Extending Mojo3D #10328

    nerobot
    Participant

    Would it add overhead compared with getting it from a String Map?

    AFAIK name of type is a minimal reflection part that directly return precompiled string.

    What is inside of Typeof I don’t know.

    It can run on every frame on several hundreds of objects,  so I think it’s important to pick the fastest way.

    Using GetComponent () inside of loops is a bad idea. You can store (cache) needed components in a private filds of objects which should use them.

     

    I dislike idea with external box container. 🙂

    in reply to: Import assets #10319

    nerobot
    Participant

    Try to use

    #Import “assets/graphics/@/graphics/”

    It should copy all files from graphics folder to the same product folder.

    After @ symbol you can specify any dest folder name.

    in reply to: Home Run Solitaire! #10315

    nerobot
    Participant

    Congrats!

    in reply to: Extending Mojo3D #10313

    nerobot
    Participant
    1. GameObj name sounds not good for me, GameObject is better
    2. GameObj have a few public global stringmaps – not good, user can clear them in any program place
    3. For adding and getting components you are using Name property, I do like that in monkey-x, but mx2 allow us to do it more clean way – using reflection:

    XXX_Bridge_YYY classes is a little magic to get acces to protected field, it allow me set protected fields and provide read-only public properties to end user (I’ll write a post about that).

    My rule is – hide under the hood as more logic as possible, stay public for really needed things.

    Also in my framework I deny directly creation of components – constructor is protected. Because I need to set it protected field _gameObject in creation time. In your code user can set null to someComponent.gameObj field and get memory access violation.

    in reply to: Extending Mojo3D #10310

    nerobot
    Participant

    Inside of your components you can store ‘raw’ monkey2 entities / parts. And manage them under the hood. 🙂

    in reply to: Extending Mojo3D #10309

    nerobot
    Participant

    As for me – GameObject is a core object which don’t extends any base class. It contains components and allow us some manipulating by setting layer and enabled properties, as well as providing OnStuff callbacks. In my framework I add OnStuff callbacks to MonkeyBehaviour class to left gameObject as simple as possible.

    Then you create any components like

    Mesh, Sprite, etc (not LoadMesh, LoadSprite)

    And then add it into game object. To simplify process you can write helper functions like

    In my framework I extends Behaviour class for scriptable, that contains ‘enabled’ property.

    (need to add repository to rely on code)

    in reply to: Extending Mojo3D #10303

    nerobot
    Participant

    I also like component-based system and even started to do similar ‘framework’ for 2d, almost unity3d-clone by concept / structure / naming.

    But I left / freeze this project.

    The most difficult thing for me was coordinate processing – each GameObject can have it’s own scale and rotation and children hierarchy. And we should to calculate local and global values, matrix matrix matrix. 🙂

    I can help to concrete problems. Looks like if you complete your wrapper – you can easily add new features. And you can start with minimal functional and extend it as needed.

    in reply to: Fill image with custom shader data #10302

    nerobot
    Participant

    Thanks for information!

    There is what I do: http://monkeycoder.co.nz/forums/topic/image-with-texture-mask/

    Maybe there is built-in support for this and I missed it.

    in reply to: Fill image with custom shader data #10296

    nerobot
    Participant

    In my case, I want to bring MaskTexture property into Image class.

    To apply texture as a mask I was going to use shader processing, and for that purpose I need to switch default ‘sprite’ shader with ‘sprite-masked’.

    Maybe you’ll add this as a core part or mojo.

    I’ll post my approach with masks in code libs soon.

    in reply to: Fill image with custom shader data #10294

    nerobot
    Participant

    Why Image.Shader property is read-only? I want to change shader on the fly. Is it possible?

    Canvas class just grab shader when render image,

    so I think we can change it and that should break nothing.

    in reply to: Fill image with custom shader data #10287

    nerobot
    Participant

    You can pass texture to shader by two ways:

    1. _image.Material.SetTexture( “myTex”,_tex )
      • in shader name will be m_myTex
    2. _image.SetTexture( 0,_tex )
      • in shader name will be m_ImageTexture0

    Note: _image.Material.SetTexture( 0,_tex ) don’t raise an exception but is incorrect.

    (0 -> toString -> “0”)

    in reply to: Fill image with custom shader data #10285

    nerobot
    Participant

    Yay, I got it myself! 🙂

    No GLWindow required, just mojo.Window.

    I missed Material.SetInt() method to pass iterations counter, so need to cast types inside of shader.

Viewing 15 posts - 346 through 360 (of 805 total)