Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: am on Sat 19/04/2003 23:33:22

Title: How to - Power Bar
Post by: am on Sat 19/04/2003 23:33:22
Hi, I need to add a power bar to a GUI, it needs to have 10 levels (plus a "0" level) and a "power up" level.
I tried using a slider for it, but this gives the user the ability to modify it, and it should only be modifidable by script.
Anyone got an Idea?

--------------------------
Check out http://www.geocities.com/bblasting for "Blaster's Blasting Adventure" game's home page
Title: Re:How to - Power Bar
Post by: RickJ on Sat 19/04/2003 23:54:31
You can use a button and SetButtonPic to do this.  You will need a different graphic for each displayable level.  Specify a graphic for the "normal" view only (not for "mouse over" and "pressed" views.  Also specify "no action" for the left click parameter.    
Title: Re:How to - Power Bar
Post by: I eat butter on Sat 19/04/2003 23:57:19
you could use RawDrawLine
Title: Re:How to - Power Bar
Post by: am on Sun 20/04/2003 21:38:22
Thanks,
I tried the RawDrawLine, but it didn't draw on the GUI, only on the room screen, and it is too much work to paint a power bar one line at a time, I think I'll go with the SetButtonPic, unless someone is writting a power-bar DLL ?
Title: Re:How to - Power Bar
Post by: BlackBaron on Sun 20/04/2003 22:43:43
You don't have to draw the bar line by line, you could use a while loop.

It is easier to use pre-drawn pictures and SetButtonPic, but note that that's not the most efficient method, it's ok if you're only using 12 different levels (10 + normal + power up), but if you need a lot more of power levels, say 100, you really should give shot to the RawDrawLine method.