Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: jess84 on December 13, 2013, 05:22:10 PM
-
Hi,
So I want to have a status bar representing a cooldown timer on my GUI.
Ideally I'd like it to be a gradient filling up from red to green over say a 5 second period.
I'm not really sure where to start with this though. Any ideas? I'm assuming something like this has been discussed before, but I couldn't find anything (other than related to levelloading)
-
easyiest way to to the "scale" is using a Sprite and scale it from 0-1. As you can setup the Pivot at the Sprite Corner you dont have to re-adjust the position while scaling. Color change can be done with color interpolation i think.
greets
Peter
-
thanks for the reply.
I don't quite get it though - how am I supposed to link the scaling to my timer? and which scale to use? "scale GUI"?
-
Do you know if anyone has shared (or even documented) how'd they've done this on the forum? It seems like a pretty standard thing - but a few searched didn't throw up any examples.
-
Here I made you a simple Sample of what I meant. An Left anchored Gauge changing fillings and color over 5 Seconds. Hope that helps. If you need to change the Pivot change it at the Sprite Inspector.
greets
Peter
-
Forgot to mention - To make it a gradient instead of plain color you may have to change the graphics I used
-
Thanks! That worked perfectly using my cooldown float :)
One (noob) question though... how would I get that to work as a GUI item on my HUD, rather than being an object within the 3D scene?
-
I prefer 3D Items - just attache it to you camera if you want to keep it in place
-
thanks, you're a star... all sorted!
-
I thought I'd post a follow-up query here instead of posted a new thread;
If I want an animated status bar in a circular shape instead;
E.g.
(http://www.hatchingdisaster.com/meter.png)
How would I approach this? I'm guessing it's a hell of a lot more complex than the horiztonal one?
-
Hi,
NGUI has a circular gauge in its toolbox so that would be sorted.
Else, yes, indeed it will be a lot more involving.
I would contact this author to see if his primitives can do truncated shapes like this circular gauge.
https://www.assetstore.unity3d.com/#/content/7382
bye,
Jean
-
easyiest way I could think of would be to do this in an 20 Frame long 2D animation and interpolate between Spritesnumbers somehow.