Text not centralizing
Posted: Fri Mar 04, 2016 1:27 am
Hey there!
I'm facing a problem where I can't centralize right my title:
How can I make the text centralize correctly? I did this:
I'm facing a problem where I can't centralize right my title:
How can I make the text centralize correctly? I did this:
Code: Select all
-- Title
self.title = {}
self.title.text = "Sample Text"
self.title.width = fonts.menu:getWidth(self.title.text)
self.title.x = const.gameWidth / 2 - self.title.width / 2
self.title.y = 15
[....]
-- Draw title
love.graphics.setFont(fonts.title)
love.graphics.print(self.title.text, self.title.x, self.title.y)