C# Class Project290.Mathematics.tfloat

This is a Transitioning float, hence the name tfloat. This acts like a regualar floating point number, but you can call GoTo with the target value and duration in seconds to have the value linearly transition there in that amount of time. The value of the float is in the "Value" variable, and this can be read and reset at any time.
Show file Open project: scastle/Solitude Class Usage Examples

Public Methods

Method Description
AtTarget ( ) : bool

Determines if the tfloat is at the target value.

GoTo ( float target ) : void

Goes to the specified target in exactly 1 second.

GoTo ( float target, float duration ) : void

Goes to the specified target in the specified amount of time.

GoTo ( float target, float duration, bool useRealTime ) : void

Goes to the specified target in the specified amount of time.

SetValue ( float value ) : void

Forces the value to be at the specified value.

Update ( ) : void

Updates this instance. This must be called every cycle or else the tfloat will not transition as expected.

tfloat ( float value ) : System

Initializes a new instance of the tfloat class.

Method Details

AtTarget() public method

Determines if the tfloat is at the target value.
public AtTarget ( ) : bool
return bool

GoTo() public method

Goes to the specified target in exactly 1 second.
public GoTo ( float target ) : void
target float The target to change the tfloat to.
return void

GoTo() public method

Goes to the specified target in the specified amount of time.
public GoTo ( float target, float duration ) : void
target float The target to change this tfloat to.
duration float The amount of time, in seconds, to take in transitioning.
return void

GoTo() public method

Goes to the specified target in the specified amount of time.
public GoTo ( float target, float duration, bool useRealTime ) : void
target float The target to change this tfloat to.
duration float The amount of time, in seconds, to take in transitioning.
useRealTime bool if set to true [use real time].
return void

SetValue() public method

Forces the value to be at the specified value.
public SetValue ( float value ) : void
value float The value.
return void

Update() public method

Updates this instance. This must be called every cycle or else the tfloat will not transition as expected.
public Update ( ) : void
return void

tfloat() public method

Initializes a new instance of the tfloat class.
public tfloat ( float value ) : System
value float The value.
return System