Trabajando en la carga de las animaciones

This commit is contained in:
2022-08-12 23:44:31 +02:00
parent 99005329de
commit d2a2a1625d
4 changed files with 112 additions and 38 deletions

View File

@@ -3,6 +3,7 @@
#include "movingsprite.h"
#include <vector>
#include <string>
#include <sstream>
#ifndef ANIMATEDSPRITE_H
#define ANIMATEDSPRITE_H
@@ -39,29 +40,29 @@ public:
// Establece el valor del contador
void setAnimationCounter(std::string name, int num);
// Establece el rectangulo para un frame de una animación
void setAnimationFrames(Uint8 index_animation, Uint8 index_frame, int x, int y, int w, int h);
// Establece la velocidad de una animación
void setAnimationSpeed(std::string name, int speed);
// Establece el numero de frames de una animación
void setAnimationNumFrames(Uint8 index, Uint8 num);
// Establece si la animación se reproduce en bucle
void setAnimationLoop(Uint8 index, bool loop);
void setAnimationLoop(std::string name, bool loop);
// Establece el valor de la variable
void setCompleted(Uint8 index, bool value);
void setCompleted(std::string name, bool value);
// Comprueba si ha terminado la animación
bool isCompleted(Uint8 index);
bool isCompleted(std::string name);
// Devuelve el rectangulo de una animación y frame concreto
SDL_Rect getAnimationClip(Uint8 index_animation, Uint8 index_frame);
SDL_Rect getAnimationClip(std::string name, Uint8 index);
// Obtiene el indice de la animación a partir del nombre
int getIndex(std::string name);
// Carga la animación desde un fichero
bool load(std::string filePath);
// Asigna variables a partir de dos cadenas
bool setVars(int index, std::string var, std::string value);
};
#endif