C# Class Myre.Delayed

A static class containing methods for fire-and-forget delayed events and transitions.
Show file Open project: TomGillen/Myre

Public Methods

Method Description
Action ( System.Action action, float delay ) : void

Fires the spevified action after the specified number of seconds have elapsed.

Transition ( Action step, float duration ) : void

Calls the specified delegate every frame for the specified number of seconds.

Transition ( Action step, float duration, System.Action completionCallback ) : void

Calls the specified delegate every frame for the specified number of seconds, and then calls the specified callback delegate.

Update ( GameTime gameTime ) : void

Updates all transitions. This is called by MyreGame.Update(gameTime).

Method Details

Action() public static method

Fires the spevified action after the specified number of seconds have elapsed.
public static Action ( System.Action action, float delay ) : void
action System.Action The delegate to execute.
delay float The delay before the action is executed.
return void

Transition() public static method

Calls the specified delegate every frame for the specified number of seconds.
public static Transition ( Action step, float duration ) : void
step Action The method to call each frame. This method takes on float parameter which is the progress from 0 to 1.
duration float The number of seconds to call the delegate for.
return void

Transition() public static method

Calls the specified delegate every frame for the specified number of seconds, and then calls the specified callback delegate.
public static Transition ( Action step, float duration, System.Action completionCallback ) : void
step Action The method to call each frame. This method takes on float parameter which is the progress from 0 to 1.
duration float The number of seconds to call the delegate for.
completionCallback System.Action The method to call on completion of the transition.
return void

Update() public static method

Updates all transitions. This is called by MyreGame.Update(gameTime).
public static Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime
return void