GlistEngine
Loading...
Searching...
No Matches
gSpriteAnimation Class Reference

#include <gSpriteAnimation.h>

Inheritance diagram for gSpriteAnimation:
Collaboration diagram for gSpriteAnimation:

Public Member Functions

 gSpriteAnimation ()
 
virtual ~gSpriteAnimation ()
 
void loadFrame (const std::string &framePath)
 
void setLoop (bool isLooped)
 
void setFps (int fps)
 
int getFps ()
 
void addConditionTrigger (std::shared_ptr< gAnimationTrigger > trigger)
 
bool isConditionTriggered ()
 
void reset ()
 
void update ()
 
void draw (int x, int y)
 
void draw (int x, int y, int w, int h)
 
- Public Member Functions inherited from gObject
 gObject ()
 
void logi (std::string message)
 
void logd (std::string message)
 
void logw (std::string message)
 
void loge (std::string message)
 
void logi (std::string tag, std::string message)
 
void logd (std::string tag, std::string message)
 
void logw (std::string tag, std::string message)
 
void loge (std::string tag, std::string message)
 

Additional Inherited Members

- Static Public Member Functions inherited from gObject
static std::string gGetAppDir ()
 
static std::string gGetAssetsDir ()
 
static void gSetAssetsDir (std::string assetsDir)
 
static std::string gGetFilesDir ()
 
static std::string gGetImagesDir ()
 
static std::string gGetFontsDir ()
 
static std::string gGetModelsDir ()
 
static std::string gGetTexturesDir ()
 
static std::string gGetShadersDir ()
 
static std::string gGetSoundsDir ()
 
static std::string gGetDatabasesDir ()
 
static std::string gGetVideosDir ()
 
static void setCurrentResolution (int scalingNo, int currentResolutionNo)
 
- Static Public Attributes inherited from gObject
static const int LOGLEVEL_SILENT
 
static const int LOGLEVEL_DEBUG
 
static const int LOGLEVEL_INFO
 
static const int LOGLEVEL_WARNING
 
static const int LOGLEVEL_ERROR
 
- Static Protected Attributes inherited from gObject
static int renderpassnum
 
static int renderpassno
 
static int releasescaling
 
static int releaseresolution
 

Constructor & Destructor Documentation

◆ gSpriteAnimation()

gSpriteAnimation::gSpriteAnimation ( )

◆ ~gSpriteAnimation()

virtual gSpriteAnimation::~gSpriteAnimation ( )
virtual

Member Function Documentation

◆ 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
xThe x coordinate to the draw the current sprite in the anim
yThe 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
xThe x coordinate to the draw the current sprite in the anim
yThe y coordinate to the draw the current sprite in the anim
wThe scaling on the x axis.
hThe 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
framePathThe 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: