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.

2D All the way! / 2d layers help

Author
Message
Beyond the Humans Knowledge
13
Years of Service
User Offline
Joined: 27th Oct 2010
Location:
Posted: 20th Jun 2011 06:34
I cant seem to figure out how to put certains sprites on certain layers, like buildings on layer 2 and grass on layer 1?? How do I do this??

onhcet d(-_-)b techno
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 20th Jun 2011 08:47
Two ways you can do this in DB. Either manually manage when the sprites are drawn (draw grass sprites first, then buildings), or use set sprite priority.

Grog Grueslayer
Valued Member
18
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 20th Jun 2011 11:32
If you're talking a 2D tile map it's better to use PASTE IMAGE rather than making all of them sprites. But with sprites the natural sprite priority is by the image number the sprite uses. Like if you had 5 sprites with image numbers 1-5 the one at the bottom will always be the one using image number 1, then 2, then 3, and so on. Doing it the "natural" way takes a bit of planning or you can use the method that Phaelax mentioned to make it easier (SET SPRITE PRIORITY).

To show you how natural sprite priority is the following randomly creates 17 sprite numbers but uses image numbers 1 to 17 on the screen and another sprite for the mouse coordinates. Move the mouse around the screen to see which image numbers are in front of and behind whatever image number the mouse sprite is using. Click the mouse button to randomly pick another image number.



Beyond the Humans Knowledge
13
Years of Service
User Offline
Joined: 27th Oct 2010
Location:
Posted: 20th Jun 2011 16:42
omg, thank you so much you both. this takes a LOAD off my mind

onhcet d(-_-)b techno

Login to post a reply

Server time is: 2024-02-23 23:37:23
Your offset time is: 2024-02-23 23:37:23