Mountain  1.0.0
Simple C++ 2D Game Framework
Mountain::Sprite Class Reference
+ Inheritance diagram for Mountain::Sprite:
+ Collaboration diagram for Mountain::Sprite:

Public Member Functions

MOUNTAIN_API Sprite (std::string spriteName)
 
MOUNTAIN_API Sprite (std::string spriteName, float_t frameDuration)
 
MOUNTAIN_API void SetupTextures ()
 Initialize the Texture vector. More...
 
MOUNTAIN_API const Pointer< Texture > & Get ()
 
MOUNTAIN_API const std::string & GetName () const
 
MOUNTAIN_API void SetName (const std::string &name)
 
MOUNTAIN_API const List< Pointer< Texture > > & GetTextures () const
 
MOUNTAIN_API size_t GetCurrentIndex () const
 
MOUNTAIN_API float_t GetFrameDuration () const
 
MOUNTAIN_API void SetFrameDuration (float_t frameDuration)
 
MOUNTAIN_API float_t GetUpdateTimer () const
 
- Public Member Functions inherited from Mountain::Component
virtual void Added ()
 Called when the component is added to an Entity.
 
virtual void Removed ()
 Called when the component is removed from an Entity.
 
virtual void Render ()
 Renders the component.
 
virtual void DebugRender ()
 
const EntityGetEntity () const
 Get the Entity on which this Component is attached.
 
EntityGetEntity ()
 Get the Entity on which this Component is attached.
 

Protected Member Functions

void Update () override
 Updates the component.
 

Additional Inherited Members

- Protected Attributes inherited from Mountain::Component
Entitym_Entity = nullptr
 Entity bound to the component.
 

Detailed Description

Definition at line 12 of file sprite.hpp.

Member Function Documentation

◆ SetupTextures()

MOUNTAIN_API void Mountain::Sprite::SetupTextures ( )

Initialize the Texture vector.

Warning
This is a quite heavy operation as it loops over all loaded textures to find the right ones and is already called in the constructor. Consider using this only when necessary, e.g. after using SetName()

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