Transició a surface: ending.cpp fet

This commit is contained in:
2025-03-03 20:48:31 +01:00
parent d7e0178602
commit b320030547
11 changed files with 128 additions and 134 deletions

View File

@@ -1,10 +1,10 @@
#pragma once
#include <SDL2/SDL_stdinc.h> // Para Uint8
#include <SDL2/SDL.h> // Para Uint8
#include <memory> // Para unique_ptr, shared_ptr
#include <string> // Para string
#include "s_sprite.h" // Para SSprite
#include "utils.h" // Para Color
#include "utils.h" // Para Uint8
class Surface; // lines 9-9
constexpr int TEXT_COLOR = 1;
@@ -55,19 +55,19 @@ public:
std::shared_ptr<Surface> writeToSurface(const std::string &text, int zoom = 1, int kerning = 1);
// Escribe el texto con extras en una textura
std::shared_ptr<Surface> writeDXToSurface(Uint8 flags, const std::string &text, int kerning = 1, Color textColor = Color(), Uint8 shadow_distance = 1, Color shadow_color = Color(), int lenght = -1);
std::shared_ptr<Surface> writeDXToSurface(Uint8 flags, const std::string &text, int kerning = 1, Uint8 textColor = Uint8(), Uint8 shadow_distance = 1, Uint8 shadow_color = Uint8(), int lenght = -1);
// Escribe el texto con colores
void writeColored(int x, int y, const std::string &text, Color color, int kerning = 1, int lenght = -1);
void writeColored(int x, int y, const std::string &text, Uint8 color, int kerning = 1, int lenght = -1);
// Escribe el texto con sombra
void writeShadowed(int x, int y, const std::string &text, Color color, Uint8 shadow_distance = 1, int kerning = 1, int lenght = -1);
void writeShadowed(int x, int y, const std::string &text, Uint8 color, Uint8 shadow_distance = 1, int kerning = 1, int lenght = -1);
// Escribe el texto centrado en un punto x
void writeCentered(int x, int y, const std::string &text, int kerning = 1, int lenght = -1);
// Escribe texto con extras
void writeDX(Uint8 flags, int x, int y, const std::string &text, int kerning = 1, Color textColor = Color(), Uint8 shadow_distance = 1, Color shadow_color = Color(), int lenght = -1);
void writeDX(Uint8 flags, int x, int y, const std::string &text, int kerning = 1, Uint8 textColor = Uint8(), Uint8 shadow_distance = 1, Uint8 shadow_color = Uint8(), int lenght = -1);
// Obtiene la longitud en pixels de una cadena
int lenght(const std::string &text, int kerning = 1) const;