Otter  0.9.88
2d Game Development Framework based on SFML.Net
 All Classes Namespaces Functions Variables Enumerations Properties
Otter.Tween Class Reference

Classes

class  TweenerImpl
 

Public Types

enum  RotationUnit { Degrees, Radians }
 

Public Member Functions

Tween From (object values)
 Apply target values to a starting point before tweening. More...
 
Tween Ease (Func< float, float > ease)
 Set the easing function. More...
 
Tween OnBegin (Action callback)
 Set a function to call when the tween begins (useful when using delays). Can be called multiple times for compound callbacks. More...
 
Tween OnComplete (Action callback)
 Set a function to call when the tween finishes. Can be called multiple times for compound callbacks. If the tween repeats infinitely, this will be called each time; otherwise it will only run when the tween is finished repeating. More...
 
Tween OnUpdate (Action callback)
 Set a function to call as the tween updates. Can be called multiple times for compound callbacks. More...
 
Tween Repeat (int times=-1)
 Enable repeating. More...
 
Tween RepeatDelay (float delay)
 Set a delay for when the tween repeats. More...
 
Tween Reflect ()
 Sets the tween to reverse every other time it repeats. Repeating must be enabled for this to have any effect. More...
 
Tween Reverse ()
 Swaps the start and end values of the tween. More...
 
Tween Rotation (RotationUnit unit=RotationUnit.Degrees)
 Whether this tween handles rotation. More...
 
Tween Round ()
 Whether tweened values should be rounded to integer values. More...
 
void Cancel (params string[] properties)
 Cancel tweening given properties. More...
 
void Cancel ()
 Remove tweens from the tweener without calling their complete functions. More...
 
void CancelAndComplete ()
 Assign tweens their final value and remove them from the tweener. More...
 
void Pause ()
 Set tweens to pause. They won't update and their delays won't tick down. More...
 
void PauseToggle ()
 Toggle tweens' paused value. More...
 
void Resume ()
 Resumes tweens from a paused state. More...
 

Properties

bool Paused [get, set]
 
float TimeRemaining [get]
 The time remaining before the tween ends or repeats. More...
 
float Completion [get]
 A value between 0 and 1, where 0 means the tween has not been started and 1 means that it has completed. More...
 
bool Looping [get]
 Whether the tween is currently looping. More...
 
object Target [get, set]
 The object this tween targets. Will be null if the tween represents a timer. More...
 

Member Function Documentation

void Otter.Tween.Cancel ( params string[]  properties)

Cancel tweening given properties.

Parameters
properties
void Otter.Tween.Cancel ( )

Remove tweens from the tweener without calling their complete functions.

void Otter.Tween.CancelAndComplete ( )

Assign tweens their final value and remove them from the tweener.

Tween Otter.Tween.Ease ( Func< float, float >  ease)

Set the easing function.

Parameters
easeThe Easer to use.
Returns
A reference to this.
Tween Otter.Tween.From ( object  values)

Apply target values to a starting point before tweening.

Parameters
valuesThe values to apply, in an anonymous type ( new { prop1 = 100, prop2 = 0} ).
Returns
A reference to this.
Tween Otter.Tween.OnBegin ( Action  callback)

Set a function to call when the tween begins (useful when using delays). Can be called multiple times for compound callbacks.

Parameters
callbackThe function that will be called when the tween starts, after the delay.
Returns
A reference to this.
Tween Otter.Tween.OnComplete ( Action  callback)

Set a function to call when the tween finishes. Can be called multiple times for compound callbacks. If the tween repeats infinitely, this will be called each time; otherwise it will only run when the tween is finished repeating.

Parameters
callbackThe function that will be called on tween completion.
Returns
A reference to this.
Tween Otter.Tween.OnUpdate ( Action  callback)

Set a function to call as the tween updates. Can be called multiple times for compound callbacks.

Parameters
callbackThe function to use.
Returns
A reference to this.
void Otter.Tween.Pause ( )

Set tweens to pause. They won't update and their delays won't tick down.

void Otter.Tween.PauseToggle ( )

Toggle tweens' paused value.

Tween Otter.Tween.Reflect ( )

Sets the tween to reverse every other time it repeats. Repeating must be enabled for this to have any effect.

Returns
A reference to this.
Tween Otter.Tween.Repeat ( int  times = -1)

Enable repeating.

Parameters
timesNumber of times to repeat. Leave blank or pass a negative number to repeat infinitely.
Returns
A reference to this.
Tween Otter.Tween.RepeatDelay ( float  delay)

Set a delay for when the tween repeats.

Parameters
delayHow long to wait before repeating.
Returns
A reference to this.
void Otter.Tween.Resume ( )

Resumes tweens from a paused state.

Tween Otter.Tween.Reverse ( )

Swaps the start and end values of the tween.

Returns
A reference to this.
Tween Otter.Tween.Rotation ( RotationUnit  unit = RotationUnit.Degrees)

Whether this tween handles rotation.

Returns
A reference to this.
Tween Otter.Tween.Round ( )

Whether tweened values should be rounded to integer values.

Returns
A reference to this.

Property Documentation

float Otter.Tween.Completion
get

A value between 0 and 1, where 0 means the tween has not been started and 1 means that it has completed.

bool Otter.Tween.Looping
get

Whether the tween is currently looping.

object Otter.Tween.Target
getset

The object this tween targets. Will be null if the tween represents a timer.

float Otter.Tween.TimeRemaining
get

The time remaining before the tween ends or repeats.


The documentation for this class was generated from the following file: