Here's a complete main.lua
(use any random image for the loading screen)
Code: Select all
love.graphics.clear()
love.graphics.draw(love.graphics.newImage('Loading.png'))
love.graphics.present()
love.timer.sleep(3) -- simulates 3 second load time
function love.draw()
love.graphics.print("Loading finished")
end
The love.run note I was talking about is in
love.graphics.present.
Edited to add: Ok, that was a bit too terse. Let me expand a bit.
1) love.graphics.clear() is needed because the contents of the screen are undefined without it. The main loop in love.graphics.run() normally takes care of that, but the whole intention here is being able to show something before (or within) love.load, which happens before the main loop.
2) The image won't be used for anything else. If you need the dimensions then sure, use a variable to hold it and let you get the size then draw it.
3) love.graphics.present() is what actually shows on the screen the image that was previously drawn, as the docs say.