Proper way to set the z-index of any sprite we add later in the game
After the game starts, I have added a sprite to a pre-existing group. But I need this sprite to be before other sprites of this group. What is the proper (less messy) way to layer a sprites that we add later into a pre-existing group?
For example, on keypress, I have added a sprite, but now need it to be first in the group.
thanks!
For example, on keypress, I have added a sprite, but now need it to be first in the group.
thanks!
Comments
i changed the z-index and tried with the z() function and nothing.