Mana
|
An animation consists of several frames, each with their own delay and offset. More...
#include <animation.h>
Public Member Functions | |
Animation ()=default | |
void | addFrame (Image *image, int delay, int offsetX, int offsetY) |
Appends a new animation at the end of the sequence. | |
void | addTerminator () |
Appends an animation terminator that states that the animation should not loop. | |
Frame * | getFrame (int index) |
Returns the frame at the specified index. | |
int | getLength () const |
Returns the length of this animation in frames. | |
int | getDuration () const |
Returns the duration of this animation in milliseconds. | |
Static Public Member Functions | |
static bool | isTerminator (const Frame &phase) |
Determines whether the given animation frame is a terminator. | |
static Animation | fromXML (XML::Node node, const std::string &dyePalettes={}) |
Loads an animation from XML. | |
Protected Attributes | |
ResourceRef< ImageSet > | mImageSet |
std::vector< Frame > | mFrames |
int | mDuration = 0 |
An animation consists of several frames, each with their own delay and offset.
Definition at line 46 of file animation.h.
|
default |
void Animation::addFrame | ( | Image * | image, |
int | delay, | ||
int | offsetX, | ||
int | offsetY | ||
) |
Appends a new animation at the end of the sequence.
Definition at line 29 of file animation.cpp.
void Animation::addTerminator | ( | ) |
Appends an animation terminator that states that the animation should not loop.
Definition at line 40 of file animation.cpp.
Loads an animation from XML.
Definition at line 50 of file animation.cpp.
|
inline |
Returns the duration of this animation in milliseconds.
Definition at line 75 of file animation.h.
|
inline |
Returns the frame at the specified index.
Definition at line 65 of file animation.h.
|
inline |
Returns the length of this animation in frames.
Definition at line 70 of file animation.h.
|
static |
Determines whether the given animation frame is a terminator.
Definition at line 45 of file animation.cpp.
|
protected |
Definition at line 91 of file animation.h.
|
protected |
Definition at line 90 of file animation.h.
|
protected |
Definition at line 89 of file animation.h.