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 / HSL HealthBar

Author
Message
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 9th Oct 2013 20:01 Edited at: 9th Oct 2013 20:02
Had this sitting on my harddrive, thought I would upload it. Maybe someone can use it?


[img]




Complete project attached.

Attachments

Login to view attachments
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 10th Oct 2013 12:21
Maybe I'm misunderstanding what you're doing but isn't it a lot simpler?



Formerly OBese87.
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 10th Oct 2013 12:55 Edited at: 10th Oct 2013 13:19
Your code is changing the hue and lightness. At 50% health the color value returned is FF807F00. Now compared to my 50% color value of FFFFFF00, you can see only the hue is changing. Before this I used your method, but wasn’t happy with the intensity change.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 12th Oct 2013 08:23
How about this:



Formerly OBese87.
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 12th Oct 2013 20:16 Edited at: 12th Oct 2013 23:13
There are minor differences, but for a healthBar I would be happy with your function. If you have actually looked at my code, you see it uses a function to convert a HSL color to RGB. This function is designed to use the same values as the Windows color dialog.

Nice job.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 14th Oct 2013 23:00
Nice job WickedX. Looking at the cool pic, it makes one wish that you could use the WASD keys and mouse to take a tour.

So many games to code.....so little time.
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 15th Oct 2013 00:19
Thanks you, LBFN.

As you probably know from my download on this thread, I have that too, minus the healthbar. It uses collision detection, lightmapping and shaders.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 15th Oct 2013 05:49
Ah yes, I remember that one. I thought it looked familiar.

So many games to code.....so little time.

Login to post a reply

Server time is: 2024-11-23 15:22:11
Your offset time is: 2024-11-23 15:22:11