Sprite zorder
Posted: Mon Oct 05, 2015 5:56 am
How to do set a sprites zorder? Say if i want it to appear behind an object, or in front, depending on Y position.
Thanks.
Thanks.
Sega Megadrive/Genesis development
http://gendev.spritesmind.net/forum/
Ah, i thought you were going to say there was no solution, but this works fine. I just change the the value in the array and it works for me. Although i am not sure if it is efficient.Stef wrote:Z ordering does not really exists on Sega Genesis, what you have internally is a linked list so sprite are drawn in order they are linked. The last draw sprite is above other sprite. In SGDK, i just consider than sprites are drawn in order they appears in the sprites array so the last sprite has the highest priority. I know that solution is definitely not convenient :-/ I need to rework out a bit the sprite engine mainly for that reason.