Game Development Community

TimerBar

by Dracola · 07/03/2006 (11:23 am) · 1 comments

Download Code File

This combines the HealthBar Gui and the GuiTimer to create a timer bar.
All the files you need are zipped up in the attachment you just need to add them to your solution.
I should probably also note that a lot of the parts I got from this gui clock resource.

here is what it might look like in script
new GuiTimerBarHud(timer) {
      Profile = "GuiDefaultProfile";
      HorizSizing = "relative";
      VertSizing = "relative";
      Position = "549 30";
      Extent = "27 194";
      MinExtent = "8 2";
      Visible = "1";
      fillColor = "0 0 0.5 0.5";
      frameColor = "0 1 0 1";
      damageFillColor = "0 1 0 1";
      pulseRate = "0";
      pulseThreshold = "0.3";
      flipped = "0";
      showFill = "1";
      showFrame = "1";
      displayEnergy = "0";
   };
also the script commands you can use on it are

timer.settime(1000);//sets it for a second.
timer.stop();//stops it and returns it to full.
timer.pause(1 or 0);//I don't know how well this works.
also when the timer hits zero it tries to run a function called "onTimerHitZero()";

#1
07/18/2006 (12:02 pm)
simple, but very very useful!
Thanks a lot!