update text.cpp
This commit is contained in:
@@ -49,20 +49,6 @@ void Text::init(LTexture *texture, SDL_Renderer *renderer, Uint8 height)
|
||||
}
|
||||
}
|
||||
|
||||
// Escribe el texto en pantalla
|
||||
void Text::write(int x, int y, std::string text)
|
||||
{
|
||||
Uint16 shift = 0;
|
||||
for (Uint8 i = 0; i < text.length(); ++i)
|
||||
{
|
||||
mSprite->setSpriteClip(mOffset[int(text[i])].x, mOffset[int(text[i])].y, mSprite->getWidth(), mSprite->getHeight());
|
||||
mSprite->setPosX(x + shift);
|
||||
mSprite->setPosY(y);
|
||||
mSprite->render();
|
||||
shift += (mOffset[int(text[i])].w);
|
||||
}
|
||||
}
|
||||
|
||||
// Escribe el texto en pantalla con kerning
|
||||
void Text::write(int x, int y, std::string text, int kerning)
|
||||
{
|
||||
@@ -78,7 +64,7 @@ void Text::write(int x, int y, std::string text, int kerning)
|
||||
}
|
||||
|
||||
// Escribe una cantidad determinada de caracteres del texto en pantalla
|
||||
void Text::write(int x, int y, std::string text, int kerning, Uint8 lenght)
|
||||
void Text::write(int x, int y, std::string text, Sint8 kerning, Uint8 lenght)
|
||||
{
|
||||
Uint16 shift = 0;
|
||||
for (Uint8 i = 0; i < lenght; ++i)
|
||||
|
||||
Reference in New Issue
Block a user