AnimatedSprite: posibilitat de resetejar o no el estat de la animació en setCurrentAnimation();
This commit is contained in:
@@ -18,7 +18,7 @@ struct Animation
|
||||
int speed; // Velocidad de reproducción
|
||||
int loop; // Frame de vuelta al terminar (-1 para no repetir)
|
||||
bool completed; // Indica si la animación ha finalizado
|
||||
int current_frame; // Frame actual en reproducción
|
||||
size_t current_frame; // Frame actual en reproducción
|
||||
int counter; // Contador para la animación
|
||||
|
||||
Animation() : name(std::string()), speed(5), loop(0), completed(false), current_frame(0), counter(0) {}
|
||||
@@ -44,10 +44,10 @@ public:
|
||||
void update() override; // Actualiza la animación
|
||||
|
||||
// --- Control de animaciones ---
|
||||
void setCurrentAnimation(const std::string &name = "default"); // Establece la animación por nombre
|
||||
void setCurrentAnimation(int index = 0); // Establece la animación por índice
|
||||
void resetAnimation(); // Reinicia la animación actual
|
||||
void setAnimationSpeed(size_t value); // Establece la velocidad de la animación
|
||||
void setCurrentAnimation(const std::string &name = "default", bool reset = true); // Establece la animación por nombre
|
||||
void setCurrentAnimation(int index = 0, bool reset = true); // Establece la animación por índice
|
||||
void resetAnimation(); // Reinicia la animación actual
|
||||
void setAnimationSpeed(size_t value); // Establece la velocidad de la animación
|
||||
|
||||
// --- Consultas ---
|
||||
bool animationIsCompleted(); // Comprueba si la animación ha terminado
|
||||
|
||||
Reference in New Issue
Block a user