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.

Dark GDK / Showing only part of a sprite?

Author
Message
prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 29th Jul 2009 13:55
For my HUD, it has a health bar that is not a straight line (that rules out "dbStretchSprite()"), but I cannot find a command that would allow me to show a part of the sprite, and hide the rest. Any clues?


Your signature has been erased by a mod
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 29th Jul 2009 15:55
You could offset the sprites UV's to only show a part of it's texture, then size it to how you want it

or

you could GetImage on the part of the sprites image that you want and paste it, I guess it would depend on what you want to do with it, for just a health bar, I think pasting should work aswell as using a sprite.


If you can, can you post a pic of your HUD, when you said health bar that isnt a straight line, you have me all curious now lol HUD graphics and interface ideas are something I need to start looking at soon myself

If it ain't broke.... DONT FIX IT !!!
prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 29th Jul 2009 18:11
This is a very early WIP shot of the HUD (the ammo, etc. is probably the final but the health bar is defo going to be changed to something that fits in more (but again, it will not be a straight line)


Your signature has been erased by a mod

Attachments

Login to view attachments
helpfull programmer
15
Years of Service
User Offline
Joined: 30th Jul 2009
Location:
Posted: 30th Jul 2009 18:55
hello,

this is my first post so lets try to start on a good note...


what I do is use a if statement,

if(health > 5)
{
dbHideSprite(....);
}

and so on.
bloodmage2
15
Years of Service
User Offline
Joined: 14th Jun 2009
Location:
Posted: 2nd Aug 2009 21:10
well, you could make a image that is just the color you have set to transparency, load that on top of your health bar, mirror(or is it flip, i cant remember which is horizontal) the sprite, then stretch it according to the amount of health.

-to the optimist, the glass is half full. to the pessimist, it is half empty, to the engineer, it is twice as big as it needs to be.

Login to post a reply

Server time is: 2024-10-06 09:30:10
Your offset time is: 2024-10-06 09:30:10