refactor(scenes): renombra ancho/altura/centre_punt residuals a anglès

This commit is contained in:
2026-05-24 08:03:28 +02:00
parent 7305d2f5dc
commit d36ad7d1c5
6 changed files with 103 additions and 103 deletions
+3 -3
View File
@@ -235,7 +235,7 @@ namespace Graphics {
}
}
void VectorText::renderCentered(const std::string& text, const Vec2& centre_punt, float scale, float spacing, float brightness, SDL_Color color) const {
void VectorText::renderCentered(const std::string& text, const Vec2& centre_point, float scale, float spacing, float brightness, SDL_Color color) const {
// Calcular dimensions del text
float text_width = getTextWidth(text, scale, spacing);
float text_height = getTextHeight(scale);
@@ -243,8 +243,8 @@ namespace Graphics {
// Calcular posición de l'esquina superior izquierda
// restant la meitat de las dimensions del point central
Vec2 top_left_position = {
.x = centre_punt.x - (text_width / 2.0F),
.y = centre_punt.y - (text_height / 2.0F)};
.x = centre_point.x - (text_width / 2.0F),
.y = centre_point.y - (text_height / 2.0F)};
// Delegar al método render() existent
render(text, top_left_position, scale, spacing, brightness, color);
+2 -2
View File
@@ -31,12 +31,12 @@ namespace Graphics {
// Renderizar string centrado en un punto
// - text: cadena a renderizar
// - centre_punt: punto central del texto (no esquina superior izquierda)
// - centre_point: punto central del texto (no esquina superior izquierda)
// - scale: factor de scale (1.0 = 20×40 px por carácter)
// - spacing: espacio entre caracteres en píxeles (a scale 1.0)
// - brightness: factor de brightness (0.0-1.0, default 1.0 = màxima brightness)
// - color: color RGBA explícit; si alpha==0 (default) s'usa l'oscil·lador global
void renderCentered(const std::string& text, const Vec2& centre_punt, float scale = 1.0F, float spacing = 2.0F, float brightness = 1.0F, SDL_Color color = {0, 0, 0, 0}) const;
void renderCentered(const std::string& text, const Vec2& centre_point, float scale = 1.0F, float spacing = 2.0F, float brightness = 1.0F, SDL_Color color = {0, 0, 0, 0}) const;
// Calcular ancho total de un string (útil para centrado).
// Es estático: no depende del estado del VectorText (el ancho viene de