#include <gSpriteAnimation.h>
◆ gSpriteAnimation()
| gSpriteAnimation::gSpriteAnimation |
( |
| ) |
|
◆ ~gSpriteAnimation()
| virtual gSpriteAnimation::~gSpriteAnimation |
( |
| ) |
|
|
virtual |
◆ addConditionTrigger()
| void gSpriteAnimation::addConditionTrigger |
( |
std::shared_ptr< gAnimationTrigger > |
trigger | ) |
|
◆ draw() [1/2]
| void gSpriteAnimation::draw |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
Draws the animation's current sprite to the specified x and y coordinates.
- Parameters
-
| x | The x coordinate to the draw the current sprite in the anim |
| y | The y coordinate to the draw the current sprite in the anim |
◆ draw() [2/2]
| void gSpriteAnimation::draw |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h |
|
) |
| |
Draws the animation's current sprite to the specified x and y coordinates and scales it by w and h in the x and y axis.
- Parameters
-
| x | The x coordinate to the draw the current sprite in the anim |
| y | The y coordinate to the draw the current sprite in the anim |
| w | The scaling on the x axis. |
| h | The scaling on the h axis. |
◆ getFps()
| int gSpriteAnimation::getFps |
( |
| ) |
|
◆ isConditionTriggered()
| bool gSpriteAnimation::isConditionTriggered |
( |
| ) |
|
◆ loadFrame()
| void gSpriteAnimation::loadFrame |
( |
const std::string & |
framePath | ) |
|
Loads an image object from the assets/image folder.
- Parameters
-
| framePath | The relative path to image file from assets/images |
◆ reset()
| void gSpriteAnimation::reset |
( |
| ) |
|
Resets the animation's framecounter and current frame.
◆ setFps()
| void gSpriteAnimation::setFps |
( |
int |
fps | ) |
|
◆ setLoop()
| void gSpriteAnimation::setLoop |
( |
bool |
isLooped | ) |
|
◆ update()
| void gSpriteAnimation::update |
( |
| ) |
|
Updates the animation's animation state.
Should be called from Canvas's update function if created seperately.
The documentation for this class was generated from the following file: