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.

Code Snippets / [DBP] Energy meter with glossy gradients

Author
Message
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Nov 2009 14:41 Edited at: 23rd Nov 2009 22:54




As the entire gradient is drawn first and then a gray box is overlayed on top to show only a percentage of the meter, the code could be optimized to not draw the gradient boxes (3 separate boxes are drawn) which are completely hidden by the gray box.


> SELECT * FROM users WHERE clue > 0
> 0 rows returned

Attachments

Login to view attachments
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Nov 2009 15:59 Edited at: 23rd Nov 2009 22:54
And just for fun, here's a demo using a slightly modified version of the function.






> SELECT * FROM users WHERE clue > 0
> 0 rows returned

Attachments

Login to view attachments
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 22nd Nov 2009 16:37
Looking good, like how you get the shine on the bars, and getting the vertical bars going which I think are a bit more work in coding look great, hope someone changes title and adds DBP to it.

Amazing how a simple bit of code changes when user get to changing it.

Dark Physics makes any hot drink go cold.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Nov 2009 20:09
doh I always forget to put a DBP tag in the title. It should work in DBC if the glossy overlay is removed since classic won't support the alpha.


> SELECT * FROM users WHERE clue > 0
> 0 rows returned
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 29th Nov 2009 00:07 Edited at: 29th Nov 2009 00:12
Already using this code for my new WIP health bars (from the code you posted in HowDo's post on wind speed)... thanks Phaelax!!

EDIT: I reversed the colours for a health bar though!


Login to post a reply

Server time is: 2024-04-20 09:02:24
Your offset time is: 2024-04-20 09:02:24