Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Timer Bars

Guad edited this page Jan 28, 2016 · 1 revision

Since version 1.6 you can easily add Timer bars to the bottom-right corner of the screen.

Timer bar

First, initialize a new TimerBarPool class that will draw all of your bars, and call the Draw(); method on tick.

 var myPool = new TimerBarPool();
 
 /* tick function */
 myPool.Draw();

Then you can easily add bars to the pool. Currently, TextTimerBar and BarTimerBar are available:

var myTextBar = new TextTimerBar("TIME LEFT", "2:00");
myPool.Add(myTextBar);

var myBar = new BarTimerBar("DISTANCE");
myBar.Percentage = 0.5f; // Half full
myBar.Percentage = 1.0f; // Full bar
myPool.Add(myBar);

// You can easily modify the bar color.
myBar.BackgroundColor = Color.Black;
myBar.ForegroundColor = Color.White;
Clone this wiki locally