Rune Engine  Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
rune::ObjectAnimation Class Reference

Class responsible for managing sprite animations and updating which frame of the animation is to be shown. More...

#include <objectAnimation.h>

Public Member Functions

 ObjectAnimation ()
 Default constructor to create a new empty animation for a rune::GameObject.
 
 ObjectAnimation (int frameWidth, int startFrame, int numFrames, int frameRate)
 Default constructor to create a new non empty animation for a rune::GameObject.
 
void setFrameRate (int frameRate)
 Set the frame rate for the animation. More...
 
int getFrameRate (void)
 Get the frame rate for the animation. More...
 
void setFrameWidth (int frameWidth)
 Set the width in pixels of each frame on the sprite sheet. More...
 
int getFrameWidth (void)
 Get the width in pixels of each frame on the sprite sheet. More...
 
void setFrameHeight (int frameHeight)
 Set the height in pixels of each frame on the sprite sheet. More...
 
int getFrameHeight (void)
 Get the height in pixels of each frame on the sprite sheet. More...
 
void setNumFrames (int numFrames)
 Set the number of frames the animation contains. More...
 
int getNumFrames (void)
 Get the number of frames the animation contains. More...
 
void setSheet (std::string const &filePath, unsigned int drawMode)
 Set the sprite sheet of the animation from a texture object. More...
 
TexturegetSheet (void)
 Get the sprite sheet of the animation. More...
 
int getCurrentFrame (void)
 Get the frame that the animation is currently on. More...
 
void setCurrentFame (int)
 Set the frame that the animation is currently on. More...
 
void incCurrentFrame (void)
 Tell the animation to go to the next frame.
 
float getAnimationDuration (void)
 Get the amount of time in seconds that the animation lasts.
 
int getStartFrame ()
 Get the frame that the animation starts on.
 
void setStartFrame (int startFrame)
 Set the frame that the animation starts on.
 

Detailed Description

Class responsible for managing sprite animations and updating which frame of the animation is to be shown.

Author
Thomas Montano
Date
April 13 2020

Member Function Documentation

◆ getCurrentFrame()

int rune::ObjectAnimation::getCurrentFrame ( void  )

Get the frame that the animation is currently on.

Returns
Which frame the animation is currently on.

◆ getFrameHeight()

int rune::ObjectAnimation::getFrameHeight ( void  )

Get the height in pixels of each frame on the sprite sheet.

Returns
The height in pixels of each frame from the sprite sheet.

◆ getFrameRate()

int rune::ObjectAnimation::getFrameRate ( void  )

Get the frame rate for the animation.

Returns
The framerate of the ObjectAnimation.

◆ getFrameWidth()

int rune::ObjectAnimation::getFrameWidth ( void  )

Get the width in pixels of each frame on the sprite sheet.

Returns
The width in pixels of each frame from the sprite sheet.

◆ getNumFrames()

int rune::ObjectAnimation::getNumFrames ( void  )

Get the number of frames the animation contains.

Returns
The total number of frames that are present in the sprite sheet.

◆ getSheet()

rune::Texture * rune::ObjectAnimation::getSheet ( void  )

Get the sprite sheet of the animation.

Returns
A pointer referencing the texture to be used as the sprite sheet.

◆ setCurrentFame()

void rune::ObjectAnimation::setCurrentFame ( int  frame)

Set the frame that the animation is currently on.

Parameters
frameThe frame that the current animation should be set to.

◆ setFrameHeight()

void rune::ObjectAnimation::setFrameHeight ( int  frameHeight)

Set the height in pixels of each frame on the sprite sheet.

Parameters
frameHeightThe height in pixels of each frame from the sprite sheet.

◆ setFrameRate()

void rune::ObjectAnimation::setFrameRate ( int  frameRate)

Set the frame rate for the animation.

Parameters
frameRateThe framerate of the new ObjectAnimation.

◆ setFrameWidth()

void rune::ObjectAnimation::setFrameWidth ( int  frameWidth)

Set the width in pixels of each frame on the sprite sheet.

Parameters
frameWidthThe width in pixels of each frame from the sprite sheet.

◆ setNumFrames()

void rune::ObjectAnimation::setNumFrames ( int  numFrames)

Set the number of frames the animation contains.

Parameters
numFramesThe total number of frames that are present in the sprite sheet.

◆ setSheet()

void rune::ObjectAnimation::setSheet ( std::string const &  filePath,
unsigned int  drawMode 
)

Set the sprite sheet of the animation from a texture object.

Parameters
filePathThe file path of the texture to be used as the sprite sheet.
drawModeThe filtering mode of the sprite.

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