i'm triyng to write a text centered in the screen that fade out and increase in size.
I wrote the following code, but the text, when increase, move from the center of the screen to the right (i wold like to mantain it centerd).
Code: Select all
ww, wh = love.graphics.getDimensions()
msgFont = love.graphics.newFont(24)
msgFontHeight = msgFont:getHeight()
msgTextOpacity = 300
msgTextSize = 1
function love.update(dt)
msgTextOpacity = msgTextOpacity - 300*dt
msgTextSize = msgTextSize + 1*dt
end
function love.draw()
love.graphics.setColor(1, 1, 1, msgTextOpacity/255)
love.graphics.setFont(msgFont)
love.graphics.printf( "Hello World", 0, wh * 0.5 - (msgFontHeight*0.5), ww, "center", r, msgTextSize, msgTextSize, ox, oy, kx, ky )
end
Can somebody help me?
Thank you