VEGO-Engine  0.1
Loading...
Searching...
No Matches
SpriteComponent Class Reference

SpriteComponent class to handle sprite rendering and animation. More...

#include <SpriteComponent.h>

Public Member Functions

 SpriteComponent (Textures texture, int zIndex)
 Constructor for SpriteComponent.
 
 SpriteComponent (Textures texture, int xOffset, int yOffset, int zIndex)
 zIndex The z-index of the sprite, used for rendering order, in order to show up on the map, the zIndex must be higher than the layer you want it to show up on
 
 SpriteComponent (const char *path, int xOffset, int yOffset, int zIndex)
 zIndex The z-index of the sprite, used for rendering order, in order to show up on the map, the zIndex must be higher than the layer you want it to show up on
 
 SpriteComponent (Textures texture, bool isAnimated, std::map< std::string, std::unique_ptr< Animation > > *animationList, std::string defaultAnimation, int zIndex)
 used for animated sprites
 

Detailed Description

SpriteComponent class to handle sprite rendering and animation.

Constructor & Destructor Documentation

◆ SpriteComponent() [1/4]

SpriteComponent::SpriteComponent ( Textures texture,
int zIndex )

Constructor for SpriteComponent.

Parameters
textureThe texture to be used for the sprite, must be a Texture enum

zIndex The z-index of the sprite, used for rendering order, in order to show up on the map, the zIndex must be higher than the layer you want it to show up on

◆ SpriteComponent() [2/4]

SpriteComponent::SpriteComponent ( Textures texture,
int xOffset,
int yOffset,
int zIndex )

zIndex The z-index of the sprite, used for rendering order, in order to show up on the map, the zIndex must be higher than the layer you want it to show up on

Parameters
textureThe texture to be used for the sprite, must be a Texture enum
xOffsetThe x offset of the sprite, used for rendering position
yOffsetThe y offset of the sprite, used for rendering position

◆ SpriteComponent() [3/4]

SpriteComponent::SpriteComponent ( const char * path,
int xOffset,
int yOffset,
int zIndex )

zIndex The z-index of the sprite, used for rendering order, in order to show up on the map, the zIndex must be higher than the layer you want it to show up on

Parameters
textureThe texture to be used for the sprite, must be a char* path
xOffsetThe x offset of the sprite, used for rendering position
yOffsetThe y offset of the sprite, used for rendering position

◆ SpriteComponent() [4/4]

SpriteComponent::SpriteComponent ( Textures texture,
bool isAnimated,
std::map< std::string, std::unique_ptr< Animation > > * animationList,
std::string defaultAnimation,
int zIndex )

used for animated sprites

Parameters
textureThe texture to be used for the sprite, must be a Texture enum
isAnimatedWhether the sprite is animated or not
animationListThe list of animations to be used for the sprite
defaultAnimationThe default animation to be used for the sprite when it first gets loaded
zIndexThe z-index of the sprite, used for rendering order, in order to show up on the map, the zIndex must be higher than the layer you want it to show up on

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