Posts: 187
Threads: 22
Joined: Dec 2020
Reputation:
1
Hi, sorry I didn't do the minimal reproductible exemple but I will do this as soon as possible.
But I wonder something, how does sprite display work? Both sprites and tiles also have priority, so, sprites seems a bit complicated.
Thanks for your answer!
Posts: 673
Threads: 33
Joined: Jan 1970
Reputation:
13
There are four passes, on each pass only effective items for that pass are drawn.
So the first pass of sprites only renders regular sprites, and the second pass only renders priority ones. The same for tiles: first pass draws regular tiles, second pass draws priority tiles. Items drawn last overdraw the ones drawn fist, so this is how priority is achieved.
Posts: 673
Threads: 33
Joined: Jan 1970
Reputation:
13
There's a list that stores, for each sprite, what index to draw next after the current one. It also stores the first sprite to draw. When you need fine control of sprite ordering, for example to implement a 3/4 view for pseudo 3D where sprites at the bottom of the screen are nearer and must be drawn overlapping the ones that are located upper on the screen, you can use TLN_SetFirstSprite() and TLN_SetNextSprite() to arrange this list. It can be tricky however.
This feature is inspired by the Sega Genesis/MegaDrive, it has a similar concept of a display list of indexes but implemented differently.