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 / Text and sprite layer priority

Author
Message
zerosimms
15
Years of Service
User Offline
Joined: 25th Feb 2011
Location:
Posted: 16th May 2011 18:35
Hey all

Wondering if you can help, I've had a look for the answer but the questions are slightly different. I have an issue with my game and layering text using the
command not print, ontop of a sprite.

Image I have a PNG the size of the game window and I want to display my characters life
ontop of the PNG. How can I do this?

I have tried SET SPRITE PRIORITY and this just either hides the sprite or places it ontop of the text.
Oh and my text is the last thing to be loaded in the script.

Any help would be great.

www.bensimms.co.uk
zerosimms
15
Years of Service
User Offline
Joined: 25th Feb 2011
Location:
Posted: 16th May 2011 19:34
I've done it!
Anyone else having this issue do the following within the loop of your game:

sprite 6,0,0,6 : hide sprite 6
paste sprite 6,0,0

Seems a bit backwards to me but nevermind it's working.

www.bensimms.co.uk
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 16th May 2011 21:03
Only the paste sprite line belongs into the loop.

Creating the sprite and hiding it are just initializing the sprite for future use.

-In.Dev.X: A unique heavy story based shoot'em ~25%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
zerosimms
15
Years of Service
User Offline
Joined: 25th Feb 2011
Location:
Posted: 16th May 2011 22:00
Thanks Quel you are quite right!

I have just noticed a slight issue though, I had some code that would trigger events on my sprite (6). Now I'm using paste I'm assuming it assigns the pasted sprite a new ID because my triggers are no longer working.

Any ideas how I can get around this?

www.bensimms.co.uk
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 17th May 2011 10:18
PASTE SPRITE is just like an ink stamp. It stamps the screen with whatever the sprite looks like. If you want to keep using SPRITE COLLISION you keep updating where the sprite is using the SPRITE command. Even if the sprite is hidden it's still on the screen at the coordinates you last put it.

zerosimms
15
Years of Service
User Offline
Joined: 25th Feb 2011
Location:
Posted: 17th May 2011 19:02
Thanks Grog, that works a treat, I feel a bit dumb for not thinking of that myself

www.bensimms.co.uk

Login to post a reply

Server time is: 2026-07-10 23:13:36
Your offset time is: 2026-07-10 23:13:36