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 / HUD is made, need some help.

Author
Message
Silver Wolf276
17
Years of Service
User Offline
Joined: 15th Feb 2007
Location:
Posted: 15th Aug 2008 04:42
Alright so I got this ugly HUD made and have it ingame.

How would I be able to put text over the HUD?

I'm currently using Sprites and here is an excerpt of my code.



The HUD topics I have looked at don't have any information on putting Text infront of the HUD so I can't really find how to do this =\

Thanks once again!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 15th Aug 2008 22:03
Short answer, you can't. There's a command "draw sprites first" that will then let you display text on top of sprites, but unfortunately, 3D objects will also appear on top. I really with DBP would get this issue fixed.

Your alternative is to display text by using an image for each letter.


Silver Wolf276
17
Years of Service
User Offline
Joined: 15th Feb 2007
Location:
Posted: 16th Aug 2008 00:07
Ah, was afraid of that.
Guess I can stop searching lol.

Thank you
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 16th Aug 2008 00:29 Edited at: 16th Aug 2008 00:32
It's quite possible with these two commands. I do it all of the time:

HIDE SPRITE
PASTE SPRITE

Just hide the sprite first, then paste its appearance where the sprite was. This way it won't always go on top.

Pseuedo Code:


Nano brain
16
Years of Service
User Offline
Joined: 7th May 2008
Location:
Posted: 16th Aug 2008 01:11
Or...take an image of text and use it with a new sprite(one with a higher z-priority than its bg counter part).

Example(not tested, but am sure everything is correct):



If I'm correct, then pasting the HUD sprite onto the screen each loop while the 3D backdrop is on may cause a major performance hit. Since sprite in DBP are literally 3D objects anyway, you will be better off going with my method here.
Silver Wolf276
17
Years of Service
User Offline
Joined: 15th Feb 2007
Location:
Posted: 16th Aug 2008 04:21
Lol it changes my hp bar at same time.
I'll fix though =)
I finally can get some HUD things done now so thank you!

Login to post a reply

Server time is: 2024-11-24 22:39:47
Your offset time is: 2024-11-24 22:39:47