kittykatattack / hexi

Make games the fun way!
MIT License
551 stars 83 forks source link

How can text content be aligned centered? #28

Open gustavoelizalde opened 7 years ago

gustavoelizalde commented 7 years ago

g.text("GAME \n OVER!", "48px Bitter-Bold", "#548DFB")

It's possible to make it centered when there's a line jump on the content?

kittykatattack commented 7 years ago

I haven't had a change to test this, but because Hexi's text method just creates a plain Pixi Text sprite, you should be able to use this technique:

http://www.html5gamedevs.com/topic/13731-aligning-of-single-text-line/