|
Muto 0.0.1
|
Animates through a series of sub textures. More...
#include <Components.h>
Public Member Functions | |
| int | GetCurrentFrame () const |
| Returns the index of the current frame. | |
| Ref< SubTexture2D > | GetCurrentSubTexture () |
| std::vector< Ref< SubTexture2D > > & | GetSubTextures () |
| operator const std::vector< Ref< SubTexture2D > > & () const | |
| operator std::vector< Ref< SubTexture2D > > & () | |
| TextureAnimationComponent ()=default | |
| TextureAnimationComponent (const std::vector< Ref< SubTexture2D > > &subTextures, float frameTime) | |
| Constructor that initializes the sub-textures and frame time. | |
| TextureAnimationComponent (const TextureAnimationComponent &)=default | |
| void | Update (float deltaTime) |
| Updates the animation based on the elapsed time. | |
Public Attributes | |
| int | CurrentFrame = 0 |
| The current frame index. | |
| float | FrameTime = 0.6f |
| Time per frame in seconds. | |
| bool | IsLooping = true |
| std::vector< Ref< SubTexture2D > > | SubTextures |
| The list of sub-textures for the animation. | |
| float | TimeAccumulator = 0.0f |
| Accumulated time for frame switching. | |
Animates through a series of sub textures.
(can be used with full textures)
|
default |
|
default |
|
inline |
Constructor that initializes the sub-textures and frame time.
| subTextures | Vector of sub-textures for the animation. |
| frameTime | Time per frame in seconds. |
References FrameTime, and TextureAnimationComponent().
Referenced by TextureAnimationComponent().
|
inline |
Returns the index of the current frame.
|
inline |
|
inline |
|
inline |
|
inline |
Updates the animation based on the elapsed time.
| deltaTime | The elapsed time since the last update. |
| int Muto::TextureAnimationComponent::CurrentFrame = 0 |
The current frame index.
Referenced by Muto::TextureAnimationEdit().
Time per frame in seconds.
Referenced by TextureAnimationComponent().
| std::vector<Ref<SubTexture2D> > Muto::TextureAnimationComponent::SubTextures |
The list of sub-textures for the animation.
| float Muto::TextureAnimationComponent::TimeAccumulator = 0.0f |
Accumulated time for frame switching.