Avoid rendering SPACE character!

This commit is contained in:
Ray 2018-02-12 11:25:00 +01:00
parent 51124bfb74
commit 8af5f9dfe0

View File

@ -418,11 +418,14 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float
}
else index = GetCharIndex(spriteFont, (unsigned char)text[i]);
if ((unsigned char)text[i] != ' ')
{
DrawTexturePro(spriteFont.texture, spriteFont.chars[index].rec,
(Rectangle){ position.x + textOffsetX + spriteFont.chars[index].offsetX*scaleFactor,
position.y + textOffsetY + spriteFont.chars[index].offsetY*scaleFactor,
spriteFont.chars[index].rec.width*scaleFactor,
spriteFont.chars[index].rec.height*scaleFactor }, (Vector2){ 0, 0 }, 0.0f, tint);
}
if (spriteFont.chars[index].advanceX == 0) textOffsetX += (int)(spriteFont.chars[index].rec.width*scaleFactor + spacing);
else textOffsetX += (int)(spriteFont.chars[index].advanceX*scaleFactor + spacing);