Center some text, since lutro now supports it

This commit is contained in:
Jean-André Santoni 2015-08-20 01:48:29 +02:00
parent 871ebc03e5
commit 71cca3f409
2 changed files with 8 additions and 8 deletions

View File

@ -255,15 +255,15 @@ function drawGame()
-- Draw game over message -- Draw game over message
if pl.alive == false then if pl.alive == false then
love.graphics.print("you didn't make it to work", 0, 30) love.graphics.printf("you didn't make it to work", 0, 30,WIDTH,"center")
love.graphics.print("press start to retry",0, 45) love.graphics.printf("press B to retry",0, 45,WIDTH,"center")
love.graphics.print("your score: ".. score .. " - highscore: " .. highscore[difficulty],0,65) love.graphics.printf("your score: ".. score .. " - highscore: " .. highscore[difficulty],0,65,WIDTH,"center")
end end
-- Draw pause message -- Draw pause message
if pause == true then if pause == true then
love.graphics.print("paused",0,30) love.graphics.printf("paused",0,30,WIDTH,"center")
love.graphics.print("press start to continue",0,45) love.graphics.printf("press start to continue",0,45,WIDTH,"center")
end end
-- Draw coffee meter -- Draw coffee meter

View File

@ -13,15 +13,15 @@ function drawMenu()
love.graphics.draw(imgSplash,86,0) love.graphics.draw(imgSplash,86,0)
elseif submenu == 1 then elseif submenu == 1 then
elseif submenu == 2 then elseif submenu == 2 then
love.graphics.print("select difficulty",0,22) love.graphics.printf("select difficulty",0,22,WIDTH,"center")
if selection > 2 then selection = 0 if selection > 2 then selection = 0
elseif selection < 0 then selection = 2 end elseif selection < 0 then selection = 2 end
for i = 0,2 do for i = 0,2 do
if i == selection then if i == selection then
love.graphics.print("* "..menu_difficulties[i+1].." *",0,42+i*13) love.graphics.printf("* "..menu_difficulties[i+1].." *",0,42+i*13,WIDTH,"center")
else else
love.graphics.print(menu_difficulties[i+1],0,42+i*13) love.graphics.printf(menu_difficulties[i+1],0,42+i*13,WIDTH,"center")
end end
end end
end end