Fading Not Working
Posted: Sat Jan 24, 2015 8:45 pm
All I get is a blank screen, I want to have a fade in and fade out thing for my game intro, but it isn't working, please help.
Code: Select all
alpha = 255
seconds = 2
function love.update(delayTime)
if alpha == 255 then
alpha = alpha-(255/seconds*delayTime)
elseif alpha == 0 then
alpha = alpha+(255/seconds*delayTime)
end
end
function love.draw()
if alpha == 255 then
love.graphics.printf("CodeX Studios Presents...", 0, 250, 800, "center")
love.graphics.setColor(255, 255, 255, alpha)
love.graphics.setNewFont(48)
elseif alpha == 0 then
love.graphics.reset()
love.graphics.printf("A Game", 0, 250, 800, "center")
love.graphics.setColor(255, 255, 255, alpha)
love.graphics.setNewFont(48)
end
end