Component that handles sprite sheet animations.
More...
#include <animator.h>
Component that handles sprite sheet animations.
The Animator component allows you to create frame-by-frame animations using a sprite sheet. You can control playback, looping, and frame timing.
Usage:
- Create an Animator with a sprite sheet and frame interval.
- Use play(), pause(), and reset() to control animation playback.
- Set specific animations using set_animation().
- The component updates the sprite texture based on the current frame.
- Note
- Ensure the parent GameObject has a Sprite component to display frames.
◆ Animator()
| Animator::Animator |
( |
const std::string & |
sprite_sheet_name, |
|
|
int |
interval_ms |
|
) |
| |
|
explicit |
◆ is_non_interruptible() [1/2]
| bool Animator::is_non_interruptible |
( |
| ) |
const |
|
noexcept |
◆ is_non_interruptible() [2/2]
| void Animator::is_non_interruptible |
( |
bool |
value | ) |
|
|
noexcept |
◆ is_playing()
| bool Animator::is_playing |
( |
| ) |
const |
|
noexcept |
◆ pause()
◆ play() [1/2]
| void Animator::play |
( |
bool |
is_looping | ) |
|
◆ play() [2/2]
| void Animator::play |
( |
const std::string & |
animation_name, |
|
|
bool |
is_looping |
|
) |
| |
◆ reset()
◆ set_animation() [1/2]
| void Animator::set_animation |
( |
const std::string & |
animation_name | ) |
|
◆ set_animation() [2/2]
| void Animator::set_animation |
( |
const std::vector< std::reference_wrapper< Texture > > & |
frames_ | ) |
|
◆ type_name()
| std::string Animator::type_name |
( |
| ) |
const |
|
overridevirtual |
Provides a consistent type name for the component.
- Returns
- A string representing the type name of the component. @CAUTION: All derived components must implement this method to ensure consistent serialization across different compilers and platforms.
Implements Component.
◆ update()
| void Animator::update |
( |
float |
dt_seconds | ) |
|
|
overridevirtual |
The documentation for this class was generated from the following file: