Code: Select all
self.show = manager.create(sprite)
self.show.x = xpos
self.show.y = ypos
# ZOrder: MaxTileHeight - Elev = Higher ZOrder for Taller Tiles
# ZOrder: + (setup_map_rows - x_coord) = Higher ZOrder for Closer Tiles
# (5 - 0) + ((5 - 0)*2) = 15
self.show.zorder = zorder
Hope it helps the next guy. ^^
----------
Hello,
I feel like this should be simple, but I find myself at a loss.
I've created a custom Sprite and I am showing it with sprite manager.
After I have loaded my sprites, I notice some are on top of others.
Rather than script mathematical logic to place them properly, I think zorder would be simplest solution.
How can I have my custom Sprite objects, created with SpriteManager, inherit a zorder attribute so the sprite manager can place each individual sprite according to the zorder?
Thanks.