TazGraph Project v0.1.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
SpriteComponent Class Reference
Inheritance diagram for SpriteComponent:
Inheritance graph
[legend]
Collaboration diagram for SpriteComponent:
Collaboration graph
[legend]

Public Member Functions

 SpriteComponent (std::string id)
 
 SpriteComponent (Color clr)
 
 SpriteComponent (std::string id, bool isMainMenu)
 
void setTex (std::string id)
 
void init () override
 
void update (float deltaTime) override
 
void draw (size_t v_index, PlaneModelRenderer &batch, TazGraphEngine::Window &window)
 
void SetAnimation (int idX, int idY, size_t fr, float sp, const Animation::animType type, int reps=0)
 
void SetMovingAnimation (int idX, int idY, size_t fr, float sp, const Animation::animType type, const std::vector< glm::vec2 > &_positions, const std::vector< int > &_zIndices, const std::vector< int > &_rotations, int reps=0)
 
void SetFlashAnimation (int idX, int idY, size_t fr, float sp, const Animation::animType type, const std::vector< float > &flashTimes, Color flashC, int reps=0)
 
void setCurrFrame ()
 
void setMoveFrame ()
 
void setSpecificMoveFrame ()
 
void setFlashFrame ()
 
void DestroyTex ()
 
void DestroyGlTex ()
 
std::string GetComponentName () override
 
void showGUI () override
 
- Public Member Functions inherited from BaseComponent
virtual void draw (size_t e_index, LineRenderer &batch, TazGraphEngine::Window &window)
 
virtual void draw (size_t e_index, PlaneColorRenderer &batch, TazGraphEngine::Window &window)
 
virtual void draw (size_t e_index, LightRenderer &batch, TazGraphEngine::Window &window)
 

Public Attributes

std::string texture_name = ""
 
Color default_color = { 255, 255, 255, 255 }
 
Color color = { 255, 255, 255, 255 }
 
TransformComponenttransform = nullptr
 
SDL_FRect srcRect = {0,0,0,0}
 
Animation animation
 
MovingAnimation moving_animation
 
FlashAnimation flash_animation
 
SDL_RendererFlip spriteFlip = SDL_FLIP_NONE
 
- Public Attributes inherited from Component
Entityentity = nullptr
 
- Public Attributes inherited from BaseComponent
ComponentID id = 0u
 

Member Function Documentation

◆ draw()

void SpriteComponent::draw ( size_t  v_index,
PlaneModelRenderer batch,
TazGraphEngine::Window window 
)
inlinevirtual

Reimplemented from BaseComponent.

◆ GetComponentName()

std::string SpriteComponent::GetComponentName ( )
inlineoverridevirtual

Reimplemented from BaseComponent.

◆ init()

void SpriteComponent::init ( )
inlineoverridevirtual

Reimplemented from BaseComponent.

◆ showGUI()

void SpriteComponent::showGUI ( )
inlineoverridevirtual

Reimplemented from BaseComponent.

◆ update()

void SpriteComponent::update ( float  deltaTime)
inlineoverridevirtual

Reimplemented from BaseComponent.


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