Game Development Community

Layer management not working?

by Tommy Leclerc · in Torque X 2D · 02/14/2011 (12:58 pm) · 3 replies

Hi!

Just downloaded Torque X to evaluate the 2D version of the engine, and I am running into some trouble getting the layer management property to work properly. In the editor, it seems to work fine (the correct sprite shows up on top of the other one in the same layer). If I switch the layer management to -Y to Y, sprites are switching order (the one that was under is now on top and vice versa). So I think that everything is fine in the editor.

But in game, no matter what sort order I set (Y or -Y), it is always the same sprite that ends up on top even if I move it around. I tested it on the Hello World tutorial, same problem. Removed all components, and still the same problem. Is this a known bug or there is something I am doing wrong? (I also tried to move the sort point, and still only makes any difference in the editor, but not in the real game.)

About the author

Recent Threads


#1
02/14/2011 (1:03 pm)
We've never used a negative layer... Example would be Layer 0 should be on top of layer 10.
#2
02/14/2011 (1:15 pm)
I am not using negative layers (is that even possible?)

What I am saying, is that when I put 2 sprites on the same layer and that they overlap each other, no matter what I set the layer management property to either Y or -Y (the documentation says this is the sort order), the same sprite always shows up on top of the other in the game.
#3
02/14/2011 (8:05 pm)
He means sorting within each layer. In the editor you can make everything on layer x sort within itself based off of the x, -x, y or -y.

If set to -y, the object with the lower y will show up on top on that layer.

Are you using the 4.0 CEV? I noticed this problem myself, if you roll back your T2DSceneGraph to revision 128 it will be fixed. Pino is working on a faster sorting method for rendering and this got a little messed up in the head revision.

If you're on the trial version then it must be a bug with whatever version they have distributed for that.