continuem afegint descripcions de lo que fa cada classe

This commit is contained in:
2024-08-12 14:16:24 +02:00
parent 9d5aee2562
commit 4d1f1d2bc2
6 changed files with 51 additions and 8 deletions

View File

@@ -177,6 +177,8 @@ void Background::setGradientNumber(int value)
// Ajusta el valor de la variable
void Background::setTransition(float value)
{
value = std::min(value, 1.0f);
value = std::max(value, 0.0f);
transition = value;
}
@@ -191,13 +193,13 @@ void Background::setPos(SDL_Rect rect)
}
// Ajusta el valor de la variable
void Background::setSrcDest(SDL_Rect value)
void Background::setSrcRect(SDL_Rect value)
{
srcRect = value;
}
// Ajusta el valor de la variable
void Background::setDstDest(SDL_Rect value)
void Background::setDstRect(SDL_Rect value)
{
dstRect = value;
}
@@ -220,6 +222,10 @@ void Background::setColor(color_t color)
// Establece la transparencia de la atenuación
void Background::setAlpha(int alpha)
{
// Evita que se asignen valores fuera de rango
alpha = std::min(alpha, 255);
alpha = std::max(alpha, 0);
// Guarda el valor actual
alphaColorTextTemp = alphaColorText;