Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Morgana retro Dungeon Crawler (uses Tilengine)
#48
Next topic, sprite index and drawing order:

Don't rely on sprite indexes to get them drawn in specific order, instead use "TLN_SetNextSprite()" to fit to your needs.

The implementation of TLN_GetAvailableSprite() is really simple, it just returns the sprite with lower id available. You don't have to choose it, and it doesn't get selected just by calling it. Think of it as just a "hint", a helper function that will return a free sprite whatever it is. There's no "available sprites list", so there aren't such things as "previous" or "next".

If you want sprite A (whatever index it has) to get drawn after sprite B -so A gets drawn on top of B-:

Code:
TLN_SetNextSprite(B, A);

On the contrary, if you want sprite A to get drawn before sprite B -so B gets drawn on top of A-, switch arguments:

Code:
TLN_SetNextSprite(A, B);
Reply


Messages In This Thread
WOW!!! - by PerspexSphinx - 11-19-2019, 07:39 AM
Morgana game (uses Tilengine) - by JaumeAlcazo - 01-02-2020, 04:23 AM
RE: Morgana retro Dungeon Crawler (uses Tilengine) - by megamarc - 10-26-2021, 06:01 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)