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.

DarkBASIC Professional Discussion / How to make sprite stay behind terrain? How to keep terrain in the foreground, and sprite in the background?

Author
Message
Men_of_Fun
9
Years of Service
User Offline
Joined: 13th Dec 2015
Location:
Posted: 27th Dec 2015 17:29
Want to put large sprite behind terrain and use it as a background for the sky, but it stays in front of the terrain, and stays there even when I'm moving around with the camera, I can see the bottom part of the terrain moving around, but the top part of the terrain is always covered by the large sprite.

So, question is, how can I make the sprite stay in the background? I tried 'draw to front' for the terrain, and 'paste sprite' to the background, but that didn't work.


David Gervais
Retired Moderator
19
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Montreal, Canada
Posted: 27th Dec 2015 19:49 Edited at: 27th Dec 2015 19:50
If memory serves me (haven't used DBPro in like 5+ years) there should be a command like "SET SPRITE PRIORITY SpriteNumber, Priority" where the the higher priority is drawn last.

(so keep the background sprite at the default value of '0' (zero) and set all other sprites to 1 or higher.)

If someone can confirm, please do.

Cheers!
WickedX
16
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 27th Dec 2015 20:56
Try; Draw Sprites First.
James H
18
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 27th Dec 2015 21:25
You will need to use "set backdrop off" as well because whenever you create 3D objects the backdrop for 3D is on by default. You can also use "draw to back" instead of "draw sprites first" if for some reason you need all 2D activity to be included but I think draw sprites last would be more useful.
WickedX
16
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 28th Dec 2015 01:14
This snippet is self-explanatory.

Derek Darkly
13
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 28th Dec 2015 02:00
You could also try the "obsolete" command TEXTURE BACKDROP n which still works, at least in my version of DBP.

Login to post a reply

Server time is: 2025-08-08 17:18:28
Your offset time is: 2025-08-08 17:18:28