• entries
    740
  • comments
    957
  • views
    730222

Progress being made (literally)

Sign in to follow this  
Gaiiden

203 views





Ta dum! I give you progress bars!! [smile]

Not bad, a widget a week eh? Sounds like a good pace to me. Hopefully I can make it two widgets a week tho. That would be nice since I still have 4 or 5 more to go.

Anyways on to the details. What you see here are actually two different kinds of progress bars. The horizontal bar is made up of two images, while the vertical bar is just made up of two rectangle primitives. Because image and rectangle objects both inherit from a base class, I'm able to use the same code for both of them. Meaning my progress bar class never needs to distinguish between the two objects, it's able to just use the functions from the base object. I could, if I wanted, make the outline a graphic and the bar a primitive, or vice versa.

The horizontal bar is demonstrating the advantage of a graphic progress bar: masking. This lets you make the bar appear to slim up or even (not demoed here) seem to empty a bottle or around a curve. You get the idea.

The vertical bar is demonstrating the advantage of a primitive progress bar: color change. I suppose I could make the grahpic bar a sprite instead of an image so that can switch bar colors too (I'd have to add that functionality) - but this way is so much simpler. And since you can have a bar primitive with an outline graphic...

The way the demo works is I set up two timers. The timers, every set number of milliseconds, message the app saying they've expired. The app then updates the proper progress bar. When the progress bar updates, it calls back the app and the app updates the text and colors. Simple.

As with the last demo, you can download it here. The source is included.

Once again, comments are appreciated!! [smile]
Sign in to follow this  


5 Comments


Recommended Comments

I notice the completion bar never goes to 100% and the health bar never reads 0%...

does this mean that I will never die, and forever have to sit, only having attained 99% because of the impossibility of achieving 100%!? What a cruel fate for one strapped to a chair betwixt the sprawls of life; the only outsource being that of his belittilified monitration apparatus perched precariously on the gargantuan pinnacle of prograss!!!

(uh-oooohh...looks like a Thesaurus overload, Batman!! Quick! TO THE POPEMOBILE!!)

Share this comment


Link to comment
Quote:

A widget a week? Sounds like you need to cut back a bit, man!

It's looking good so far. Makes me want to work on my shoddy GUI system too.

Are you calling my GUI shoddy?!? *draws sword* [wink]

Quote:

I notice the completion bar never goes to 100% and the health bar never reads 0%...

Good catch [smile] I'm resetting the progress bars when they reach 0/100, not after they reach 0/100. Meaning I reset them before they render the fact that they are at 0 or 100. If I had let them just run out, they would indeed reach max. Of course I could have coded it so that it would show their max values before resetting, but I was being lazy [smile]
Quote:

Looks very nice. A question though: the window in the picture, is that in engine or windows with a theme? If windows with a theme, what theme is it?

It's a theme I'm using with styleXP called ASUS. In none of these screens is the window part of my engine, it's just an SDL-created window
Quote:

Very cool.

Thanks! [smile]

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now