diff options
| author | Ray <[email protected]> | 2018-02-12 11:25:00 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2018-02-12 11:25:00 +0100 |
| commit | 8af5f9dfe0e23d918bb88a5fca9e5671c9100f3a (patch) | |
| tree | 298dc5f3d8890bdb478c73c3737c751486b6ec5b /src/text.c | |
| parent | 51124bfb74832cf381c9c1169ce8c9636096446d (diff) | |
| download | raylib-8af5f9dfe0e23d918bb88a5fca9e5671c9100f3a.tar.gz raylib-8af5f9dfe0e23d918bb88a5fca9e5671c9100f3a.zip | |
Avoid rendering SPACE character!
Diffstat (limited to 'src/text.c')
| -rw-r--r-- | src/text.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -417,12 +417,15 @@ void DrawTextEx(SpriteFont spriteFont, const char *text, Vector2 position, float i++; } else index = GetCharIndex(spriteFont, (unsigned char)text[i]); - - DrawTexturePro(spriteFont.texture, spriteFont.chars[index].rec, + + 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); |
