Ya sale de la demo con cualquier tecla

This commit is contained in:
2022-10-24 21:54:57 +02:00
parent 38c18ae676
commit fa6d73f7f4
3 changed files with 23 additions and 9 deletions

View File

@@ -72,10 +72,14 @@ void Text::writeDX(Uint8 flags, int x, int y, std::string text, int kerning, col
const bool stroked = ((flags & TXT_STROKE) == TXT_STROKE);
if (centered)
{
x -= (Text::lenght(text, kerning) / 2);
}
if (shadowed)
{
writeColored(x + shadowDistance, y + shadowDistance, text, shadowColor, kerning, lenght);
}
if (stroked)
{
@@ -91,9 +95,13 @@ void Text::writeDX(Uint8 flags, int x, int y, std::string text, int kerning, col
}
if (colored)
{
writeColored(x, y, text, textColor, kerning, lenght);
}
else
{
write(x, y, text, kerning, lenght);
}
}
// Obtiene la longitud en pixels de una cadena