AnimatedSprite: afegit setAnimationSpeed()

This commit is contained in:
2025-06-30 17:38:54 +02:00
parent 81b4de0601
commit e4ef4700d3
2 changed files with 7 additions and 0 deletions

View File

@@ -246,4 +246,10 @@ void AnimatedSprite::loadFromAnimationsFileBuffer(const AnimationsFileBuffer &so
// Pone un valor por defecto
setWidth(frame_width);
setHeight(frame_height);
}
// Establece la velocidad de la animación
void AnimatedSprite::setAnimationSpeed(size_t value)
{
animations_[current_animation_].speed = value;
}

View File

@@ -47,6 +47,7 @@ public:
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
// --- Consultas ---
bool animationIsCompleted(); // Comprueba si la animación ha terminado