Repository navigation
Functions
(
const char* AnimatorName,
unsigned int NumOfFramesPerRow,
unsigned int NumOfRows,
unsigned int Speed,
bool bPlayInReverse = false,
bool bContinuous = false,
bool bLooping = true
)
Creates an animator instance.
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?
(
const Texture2D& Sprite
)
Assigns a sprite for the animator to use. (This should be called once)
Sprite: The sprite the animator will use.
(
const bool bLooping
)
Set whether the animator should loop or not.
bLooping: Should the animator loop?
(
const bool bIsContinuous
)
Set whether the animator should go to the next row in the sprite sheet or not.
bIsContinuous: Should the animator continue to the next row?
(
const unsigned int Framerate
)
Set a new framerate the animator will use.
Framerate: The new speed of animation.
Returns: The sprite texture.
Returns: The Frame rectangle. (Used for drawing the sprite)
Returns: The total amount of frames in the sprite-sheet.
Returns: The total rows in the sprite-sheet.
Returns: The total columns per row.
Returns: The current frame the animator is on. (Zero based)
Returns: The current row the animator is on. (Zero based)
Returns: The current column the animator is on. (Zero based)
Returns: The total time the animation will take to finish in frames.
Returns: The time remaining in frames.
Returns: The total time the animation will take to finish in seconds.
Returns: The time remaining in seconds.
Returns: The name of the animator.
(
const Texture2D& NewSprite,
unsigned int NumOfFramesPerRow,
unsigned int NumOfRows,
unsigned int Speed,
float DelayInSeconds = 0.0f,
bool bPlayInReverse = false,
bool bContinuous = false,
bool bLooping = true
)
Changes the sprite the animator is using.
NewSprite: The new sprite the animator will change to. Will reset to beginning frame.
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.
DelayInSeconds: The amount of time (in seconds) to change to the new sprite. A value of 0.0f is instant/no delay.
bPlayInReverse: Should the animator play the new 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?
(
bool bHorizontalFlip,
bool bVerticalFlip = true
)
Flips the sprite-sheet horizontally or vertically, or both.
bHorizontalFlip: Flips the sprite sheet horizontally. DOES NOT WORK, set this to false.
bVerticalFlip: Flips the sprite sheet vertically.
(
const unsigned int FrameNumber
)
Jump to a frame in the sprite-sheet.
FrameNumber: The frame number in the sprite sheet. (Zero-based)
(
const unsigned int RowNumber
)
Jump to a row in the sprite-sheet.
RowNumber: The row number in the sprite sheet. (Zero-based)
(
const unsigned int ColumnNumber
)
Jump to a column in the current row.
ColumnNumber: The column number in the sprite sheet. (Zero-based)
Jump to the first row.
Jump to the first column.
Jump to the last row.
Jump to the last column.
Jump to the first frame in the current row.
Jump to the last frame in the current row.
Jump to the first frame in the sprite sheet.
Jump to the last frame in the sprite sheet.
Jump to the next row index.
Jump to the previous row index.
Jump to the next column index.
Jump to the previous column index.
Play animation from the current frame.
Start the animation when it has been paused or has been stopped.
Stop the animation from playing.
(
const bool bToggle = false
)
Pause the animation.
bToggle: If true, flip-flop between pausing and un-pausing the animation every time when called. If false, pause the animation. You need to call UnPause to start the animation again.
UnPause the animation. (Start playing)
Set the play mode to forward.
(
const bool bToggle = false
)
Set the play mode to reverse.
bToggle: If true, flip-flop between reversing and un-reversing the play mode every time when called. If false, reverse the play mode. You need to call Forward to un-reverse.
Restart the animation from the beginning.
(
const unsigned int FrameNumber
)
Is the animator currently on the frame number specified?
FrameNumber: The frame number to query. (Zero based)
Returns: If the animator is on the frame number specified, true. Otherwise, false.
(
const unsigned int RowNumber
)
Is the animator currently on the row number specified?
RowNumber: The row number to query. (Zero based)
Returns: If the animator is on the row number specified, true. Otherwise, false.
(
const unsigned int ColumnNumber
)
Is the animator currently on the column number specified?
ColumnNumber: The column number to query. (Zero based)
Returns: If the animator is on the column number specified, true. Otherwise, false.
Is the animator currently on the first frame of the sprite-sheet?
Returns: If the animator is on the first frame of the sprite-sheet, true. Otherwise, false.
Is the animator currently on the last frame of the sprite-sheet?
Returns: If the animator is on the last frame of the sprite-sheet, true. Otherwise, false.
Is the animator currently on the first frame of a current row?
Returns: If the animator is on the first frame, true. Otherwise, false.
Is the animator currently on the last frame of a current row?
Returns: If the animator is on the last frame, true. Otherwise, false.
Is the animator currently on the first row of the sprite-sheet?
Returns: If the animator is on the first row, true. Otherwise, false.
Is the animator currently on the last row of the sprite-sheet?
Returns: If the animator is on the last row, true. Otherwise, false.
Is the animator currently on the first column of a current row?
Returns: If the animator is on the first column, true. Otherwise, false.
Is the animator currently on the last column of a current row?
Returns: If the animator is on the last column, true. Otherwise, false.
Is the animator currently playing?
Returns: If the animator is currently playing, true. Otherwise, false.
Has the animator started playing?
Returns: If the animator started playing, true. Otherwise, false.
Has the animator finished playing?
Returns: If the animator finished playing, true. Otherwise, false.