Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Z-order of Sprites

Author
Message
prolulzibus
15
Years of Service
User Offline
Joined: 29th Apr 2009
Location:
Posted: 29th Apr 2009 23:27
I have a tilemap of non-animated sprites, and there will be an animated sprite over them which is the size of the game screen. However, no matter where I put the dbPlaySprite command the animated sprite ends up getting drawn behind the tilemap. How can I manipulate the Z-order of the sprites? I've tried dbDrawToFront, but that wouldn't work anyway, would it?
ABXG
15
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Canada
Posted: 30th Apr 2009 00:43 Edited at: 30th Apr 2009 00:43
From the documentation:


------------------------------------
Currently 1300+ lines of code into an "over-the-shoulder" action RPG with combat based on rag-doll physics.
Krisacz
15
Years of Service
User Offline
Joined: 3rd Mar 2009
Location: UK, Manchester
Posted: 30th Apr 2009 12:00
I usually create function to control sprites priority just like that:


In that case sprite with id = 1, will be on "bottom" of screen, then on top of it will be sprite 2 and so on....
Just insert that somewhere in you game/program main loop.
prolulzibus
15
Years of Service
User Offline
Joined: 29th Apr 2009
Location:
Posted: 1st May 2009 22:55
Yes, setting the priority works perfectly, thank you.

Login to post a reply

Server time is: 2024-09-30 23:11:45
Your offset time is: 2024-09-30 23:11:45