Skip to content

Functions

Ali El Saleh edited this page May 7, 2019 · 13 revisions

List of all available functions

Constructor

Animator

(
    const char* AnimatorName, 
    unsigned int NumOfFramesPerRow, 
    unsigned int NumOfRows, 
    unsigned int Speed, 
    bool bPlayInReverse = false, 
    bool bContinuous = false, 
    bool bLooping = true 
)

AnimatorName: A name the animator will be identified by.
NumOfFramesPerRow: The amount of frames/columns in a row.
NumOfRows: The amount of rows in the sprite sheet.
Speed: The animation speed in frames per second.
bPlayInReverse: Should the animator play the sprite in reverse play mode?
bContinuous: Should the animator automatically go to the next row in the sprite sheet?
bLooping: Should the animator loop indefinitely?

Setters

void AssignSprite

(        
    const Texture2D& Sprite 
)  

Sprite: The sprite the animator will use.


void SetLooping

(
    const bool bLooping
)

bLooping: Set whether the animator should loop.


void SetContinuous

(
    const bool bIsContinuous
)

bIsContinuous: Set whether the animator should go to the next row in the sprite sheet.

Getters

unsigned int GetTotalFrames() const;

Returns: The total amount of frames in the sprite-sheet.

unsigned int GetTotalRows() const;

Returns: The total rows in the sprite-sheet.

unsigned int GetTotalColumns() const;

Returns: The total columns per row.

unsigned int GetCurrentFrame() const;

Returns: The current frame the animator is on. (Zero based)

unsigned int GetCurrentRow() const;

Returns: The current row the animator is on. (Zero based)

unsigned int GetCurrentColumn() const;

Returns: The current column the animator is on. (Zero based)

unsigned int GetTotalTimeInFrames() const;

Returns: The total time the animation will take to finish in frames.

unsigned int GetTimeRemainingInFrames() const;

Returns: The time remaining in frames.

float GetTotalTimeInSeconds() const;

Returns: The total time the animation will take to finish in seconds.

float GetTimeRemainingInSeconds() const;

Returns: The time remaining in seconds.

const char* GetName() const;

Returns: The name of the animator.

Clone this wiki locally