Tileson 1.4.0
A helpful json parser for Tiled maps
Loading...
Searching...
No Matches
Public Member Functions | List of all members
tson::Animation Class Reference

#include <Animation.hpp>

Public Member Functions

 Animation ()=default
 
 Animation (const std::vector< tson::Frame > &frames)
 
void update (float timeDeltaMs)
 
void reset ()
 
void setFrames (const std::vector< tson::Frame > &frames)
 
void setCurrentFrame (uint32_t currentFrame)
 
void setTimeDelta (float timeDelta)
 
const std::vector< tson::Frame > & getFrames () const
 
const tson::FramegetCurrentFrame () const
 
uint32_t getCurrentFrameNumber () const
 
uint32_t getCurrentTileId () const
 
float getTimeDelta () const
 
bool any () const
 
size_t size () const
 

Constructor & Destructor Documentation

◆ Animation() [1/2]

tson::Animation::Animation ( )
inlinedefault

◆ Animation() [2/2]

tson::Animation::Animation ( const std::vector< tson::Frame > &  frames)
inline

Member Function Documentation

◆ any()

bool tson::Animation::any ( ) const
inline

True if any frames exists, false otherwise

Returns

◆ getCurrentFrame()

const tson::Frame * tson::Animation::getCurrentFrame ( ) const
inline

Gets the current frame or nullptr if no frame is found.

Returns

◆ getCurrentFrameNumber()

uint32_t tson::Animation::getCurrentFrameNumber ( ) const
inline

◆ getCurrentTileId()

uint32_t tson::Animation::getCurrentTileId ( ) const
inline

◆ getFrames()

const std::vector< tson::Frame > & tson::Animation::getFrames ( ) const
inline

◆ getTimeDelta()

float tson::Animation::getTimeDelta ( ) const
inline

◆ reset()

void tson::Animation::reset ( )
inline

Resets the current frame and time delta to 0.

◆ setCurrentFrame()

void tson::Animation::setCurrentFrame ( uint32_t  currentFrame)
inline

◆ setFrames()

void tson::Animation::setFrames ( const std::vector< tson::Frame > &  frames)
inline

◆ setTimeDelta()

void tson::Animation::setTimeDelta ( float  timeDelta)
inline

◆ size()

size_t tson::Animation::size ( ) const
inline

◆ update()

void tson::Animation::update ( float  timeDeltaMs)
inline

Update animation based on the fra

Parameters
timedeltaMsTime in milliseconds

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