From: Alexis Laferrière Date: Sat, 29 Apr 2017 12:56:38 +0000 (-0400) Subject: gamnit: fix X position of first char of a TextSprites X-Git-Url: http://nitlanguage.org gamnit: fix X position of first char of a TextSprites Signed-off-by: Alexis Laferrière --- diff --git a/lib/gamnit/tileset.nit b/lib/gamnit/tileset.nit index 67bd32c..f932f61 100644 --- a/lib/gamnit/tileset.nit +++ b/lib/gamnit/tileset.nit @@ -157,12 +157,12 @@ class TextSprites if text == null then return # Build new sprites - var dx = font.vspace.to_f/2.0 + var dx = font.advance/2.0 var dy = font.hspace.to_f/2.0 for c in text do if c == '\n' then dy -= font.height.to_f + font.vspace.to_f - dx = font.vspace.to_f/2.0 + dx = font.advance/2.0 continue else if c.is_whitespace then dx += font.advance