nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gamnit: fix X position of first char of a TextSprites
[nit.git]
/
lib
/
gamnit
/
tileset.nit
diff --git
a/lib/gamnit/tileset.nit
b/lib/gamnit/tileset.nit
index
67bd32c
..
f932f61
100644
(file)
--- a/
lib/gamnit/tileset.nit
+++ b/
lib/gamnit/tileset.nit
@@
-157,12
+157,12
@@
class TextSprites
if text == null then return
# Build new sprites
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
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
continue
else if c.is_whitespace then
dx += font.advance