C# Class Indiefreaks.Xna.Core.Timer

An object that invokes an action after an amount of time has elapsed and optionally continues repeating until told to stop.
Mostra file Open project: Indiefreaks/igf

Public Methods

Method Description
Create ( float tickLength, bool repeats, Action tick ) : Timer

Creates a new Timer.

Stop ( ) : void

Stops the timer.

Update ( float dt ) : void

Updates all the Timers.

Method Details

Create() public static method

Creates a new Timer.
public static Create ( float tickLength, bool repeats, Action tick ) : Timer
tickLength float The amount of time between the timer's ticks.
repeats bool Whether or not the timer repeats.
tick Action An action to perform when the timer ticks.
return Timer

Stop() public method

Stops the timer.
public Stop ( ) : void
return void

Update() public static method

Updates all the Timers.
public static Update ( float dt ) : void
dt float The elapsed time (in seconds) to advance the timers. Generally you want to pass in (float)gameTime.ElapsedGameTime.TotalSeconds from your main Game class.
return void