Hello my Gideros friends.
I still do not understand how sprites and images are handled when they are placed sequentially.
In my test code I use a single stage. I first do some background stuff then the bodies and spites.
For every addition I use: stage:addChildAt(bitmap, x), So at the end I have 11 indexes (layers).
Some sprites with body are handled dynamicly. Problem is that a dynamic body (index 6) will be
updated in the onEnterFrame will always be placed on top of a image who has an index of 10.
Weird?
Thanks in advance,
Marc
Comments
will be updated in the onEnterFrame() What you see is that sprite4
will be presented below the testSprites on layer 3. Am I right that
you can add more than one sprites on one index (layer)?
Regards,
Marc
on top of sprite4?
Regards,
Marc
But, as @zvardin says, you can't add multiple sprites at index 3, so I'm not sure what happens when you try to do that in your code.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Marc
think of it as cards, if you place a card on top of the pile, the first card now moves down. repeat this a couple of times by adding a new card on the top of the pile, your top most card would now be at position 'n', n being the number of cards you added on top of the pile.
Therefore to make things easier, you can also group the sprites into groups, so that the groups can then be moved to front or back with all the containing sprites. Almost like a layer with several sprites on them.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Regards,
Marc
Once you code it it's just 3 steps:
1) the main game handling the table.
2) the sort
3) creating/remapping/hiding/clipping the on screen objects.
Likes: Nascode
https://deluxepixel.com
Best regards,
Marc