1
Graphics / Sprite layering
« on: March 14, 2012, 09:14:06 pm »
Hay all, I've made a "SpriteManager" class which takes a bunch of "gameObjects" (which is a class which inherits from sf::Sprite) and sorts them by their zIndex. The SpriteManager then draws the gameObjects to the screen based on their zIndex.
This gives me a lot more control over the ordering of the sprites. However there still seems to be an issue where the ordering does sit right. It seems that the only way to do this correct is to sort them by how they appear on the screen. The sprites at the very top of the screen are drawn first and the ones at the bottom are drawn last.
Is this the only way to do this? What other ways are there to tackle this problem
This gives me a lot more control over the ordering of the sprites. However there still seems to be an issue where the ordering does sit right. It seems that the only way to do this correct is to sort them by how they appear on the screen. The sprites at the very top of the screen are drawn first and the ones at the bottom are drawn last.
Is this the only way to do this? What other ways are there to tackle this problem