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 Discussion / sprite layer. How do I get one sprite in front of the other?

Author
Message
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Dec 2008 14:51
Hey guys!

So how do I get the dump sprite 1-12 to draw in front of sprite 1000? I have a programm with a lot of sprites, and all of the buttons are drawn behind the big sprite.

TheComet

Peachy, and the Chaos of the Gems

zenassem
22
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 9th Dec 2008 16:01
Does DBC have the set sprite priority command like DBP? It's been a while since I used DBC?

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Dec 2008 16:34
Nope, it hasn`t...

Peachy, and the Chaos of the Gems

zenassem
22
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 9th Dec 2008 16:45
ouch!

it seems in DBC you need to create the sprites in the order of their priority. The last sprites created are on top of previous created sprites.

I would have to look to see whether you can create the sprites, and then just change the image as needed. In this fashion you would have a system that a sprite with a lower number is drawn before sprites with a higher number.

~Zenassem
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 9th Dec 2008 17:22
I have run into this problem before. I have used 2 solutions:

1)As zenassem said, create the sprites from back to front

2)Use paste sprite for the big sprite in the back


come to think of it, I believe that their was a DRAW TO FRONT command somewhere, might be what you mean, will look it up later when I have time if no one has posted since this.

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Dec 2008 19:31
DRAW TO FRONT is for 2d on top of 3d and DRAW TO BACK is for 3d on top of 2d. Sprites are always on top of everything regardless.

BN2's and zenassem's solutions for priority are the ways to do it.

Check out

Sprite behind other sprite

and

Re-order Sprites

Enjoy your day.
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 10th Dec 2008 08:19
OK, thanks guys!

TheComet

Peachy, and the Chaos of the Gems

Login to post a reply

Server time is: 2025-06-07 20:49:08
Your offset time is: 2025-06-07 20:49:08