JugiMap Framework
Tween Class Reference

The Tween class defines transition between two values over time. More...

#include <jmCommon.h>

Public Types

enum  Mode { NORMAL, REVERSE, LOOP, LOOP_REVERSE }
 The tween mode. More...
 

Public Member Functions

void Init (float _valueStart, float _valueEnd, float _durationS, Easing::Kind _easingKind)
 Initialize the parameters of this tween. More...
 
void Play ()
 Start running this tween. More...
 
float Update ()
 Updates the tween value and returns it. More...
 
bool IsIdle ()
 Returns true if this tween is not running; otherwise return false. More...
 
void Stop ()
 Stop running the tween. More...
 
void Pause ()
 Pause running the tween. More...
 
void Resume ()
 Resume running the tween. More...
 
void SetEasingKind (Easing::Kind _kind)
 Set the easing kind of this tween. More...
 
void SetMode (Mode _mode)
 Set the mode of this tween. More...
 
float GetStartValue ()
 Returns the starting value of this tween;. More...
 
float GetEndValue ()
 Returns the end value of this tween;. More...
 

Detailed Description

The Tween class defines transition between two values over time.

Member Enumeration Documentation

◆ Mode

enum Mode
strong

The tween mode.

Enumerator
NORMAL 

The tween runs from the starting value to the end value and then stops.

REVERSE 

The tween runs from the end value to the start value and then stops.

LOOP 

The tween runs in loops from the start value to the end value.

LOOP_REVERSE 

The tween runs in loops from the start value to the end value and reverse direction on each loop.

Member Function Documentation

◆ Init()

void Init ( float  _valueStart,
float  _valueEnd,
float  _durationS,
Easing::Kind  _easingKind 
)

Initialize the parameters of this tween.

Parameters
_valueStartThe starting value.
_valueEndThe end value.
_durationSDuration of one loop in seconds.
_easingKindThe easing kind.

◆ Play()

void Play ( )

Start running this tween.

◆ Update()

float Update ( )

Updates the tween value and returns it.

This function must be called inside the application update loop.

◆ IsIdle()

bool IsIdle ( )
inline

Returns true if this tween is not running; otherwise return false.

◆ Stop()

void Stop ( )

Stop running the tween.

◆ Pause()

void Pause ( )

Pause running the tween.

See also
Resume

◆ Resume()

void Resume ( )

Resume running the tween.

See also
Pause

◆ SetEasingKind()

void SetEasingKind ( Easing::Kind  _kind)
inline

Set the easing kind of this tween.

◆ SetMode()

void SetMode ( Mode  _mode)
inline

Set the mode of this tween.

◆ GetStartValue()

float GetStartValue ( )
inline

Returns the starting value of this tween;.

◆ GetEndValue()

float GetEndValue ( )
inline

Returns the end value of this tween;.


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