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 / a question so simple that i'm embarresed to ask but...

Author
Message
Chilled Programmer 420
19
Years of Service
User Offline
Joined: 24th Nov 2005
Location: NOT SAYING!, i dont wanna get kidnapped!
Posted: 27th Jan 2006 12:15
for some reason i cant get t ext to apear on top of a sprite, i can make it to apear on the screen with sprites, but not on top, ive tried sprite priority, writing the text befor, after, and every command i can see for text, sprites, and core that looks like it would work, the only thing i can think of is this is a nuffa error om my version of dbp
if someone posts a small snippet of code that does this job and it doesnt work for me, ill know thats why(and be releived it isnt due to me being dumb )
thnx

[url=www.freewebs.com/tyhrfg][img]bruce.bmp[/img][/url]
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 27th Jan 2006 12:36 Edited at: 27th Jan 2006 12:37
It's not you, that's a DBpro issue.

Not to worry, there's a way around it. Rather than let Dbpro render the sprites for you (during the sync process), you manually render them using "Paste Sprite". Once your sprite(S) has been drawn, remember to hide them (or move them off screen) other wise DBpro will render them during the Sync.

Another way, is render/cache your text to an image, then make that sprite.

Chilled Programmer 420
19
Years of Service
User Offline
Joined: 24th Nov 2005
Location: NOT SAYING!, i dont wanna get kidnapped!
Posted: 27th Jan 2006 12:41
cool, that was annoying, amount of times ive needed text ontop of a sprite, thats seems like a bit of a roundabout way of doing it, but aslong as it works, thnx

[url=www.freewebs.com/tyhrfg][img]bruce.bmp[/img][/url]
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 27th Jan 2006 14:06
i allways use paste sprite, main advantage is you can paste it multiple times, very usefull for menus and things that require many of the same sprites.

Halowed are the ori.
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 27th Jan 2006 14:22
DBP has a special command for disabling it:

draw sprites first will draw first the sprites, then the other 2D.
(draw sprite last will do it the other way. This one is the default!)



It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 27th Jan 2006 14:42
Sven B is correct but if you are using any 3D objects then it is useless as the 3D stuff is drawn after the sprites, thus obscuring them. For 2D only games, then it will work.

Ideally what we need is the draw order of; 3d, Sprites, 2d+text but you can't do that unfortunately.

Once you start writing a proper game you will inevitably use graphics for text anyway as built in text commands look naff in a game.

Boo!
Peter H
21
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 27th Jan 2006 16:06
one problem with "paste sprite" is that the sprite collision commands don't work with it... because you are just "pasting" the sprite there... it's not really there...

"We make the worst games in the universe..."
Grog Grueslayer
Valued Member
20
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 27th Jan 2006 23:38
He could also create a bitmap to make a new image with text over it. That way he can keep the ability of sprite collision.




Login to post a reply

Server time is: 2025-06-09 05:03:36
Your offset time is: 2025-06-09 05:03:36