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.

Newcomers DBPro Corner / One Sprite Appear Over/On Top Of Another

Author
Message
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 10th Aug 2006 17:45 Edited at: 10th Aug 2006 17:50
I am working on a level editor and I was wondering how I would go about making the sprite that is the mouse appear on top of the buttons instead of under them.

At the moment the mouse sprite appears under all of my buttons, but I would like it to appear on top. I tried drawing the mouse sprite last, but still no luck; and the code is very messy and is part of a larger project so I would rather not post it here. Anyway, I have no idea what is wrong as I am kind of new to 2D... does anybody have any ideas? I've attached an example picture, the mouse is the light blue circle.



Attachments

Login to view attachments
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 10th Aug 2006 18:12 Edited at: 10th Aug 2006 18:17
SET SPRITE PRIORITY is your friend. Set mouse sprite's priority higher than button sprites and it should draw last.

Example code. Run it and mouse sprite goes behind other sprites. Uncomment the priority line and it is now in front.



Boo!
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 10th Aug 2006 18:20 Edited at: 29th Jun 2007 04:41
Wow, I never knew about that command! Thanks for that

Login to post a reply

Server time is: 2024-11-26 13:47:09
Your offset time is: 2024-11-26 13:47:09