Acabat el nou motor per a textos en pantalla

This commit is contained in:
2024-10-30 09:25:28 +01:00
parent b43782786a
commit 20c51d0796
11 changed files with 269 additions and 274 deletions

View File

@@ -1,11 +1,11 @@
#pragma once
#include <SDL2/SDL_rect.h> // Para SDL_Point
#include <memory> // Para shared_ptr
#include <functional>
#include <vector> // Para vector
#include "animated_sprite.h" // Para AnimatedSprite
class Texture; // lines 5-5
#include <SDL2/SDL_rect.h> // for SDL_Point
#include <functional> // for function
#include <memory> // for shared_ptr
#include <vector> // for vector
#include "sprite.h" // for Sprite
class Texture; // lines 8-8
enum class PathType
{
@@ -13,6 +13,13 @@ enum class PathType
HORIZONTAL,
};
enum class PathCentered
{
ON_X,
ON_Y,
NONE,
};
// Estructuras
struct Path
{
@@ -35,7 +42,6 @@ class PathSprite : public Sprite
{
private:
// Variables
bool finished_ = false; // Indica si ya ha terminado
bool enabled_ = false; // Indica si el objeto está habilitado
int current_path_ = 0; // Path que se está recorriendo actualmente
std::vector<Path> paths_; // Caminos a recorrer por el sprite
@@ -58,7 +64,7 @@ public:
void update();
// Añade un recorrido
void addPath(Path path);
void addPath(Path path, bool centered = false);
void addPath(std::vector<SDL_Point> spots, int waiting_counter);
void addPath(int start, int end, PathType type, int fixed_pos, int steps, const std::function<double(double)> &easingFunction, int waiting_counter);