SIMPLE Loading Screen?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Greninjask
Prole
Posts: 6
Joined: Sun Mar 20, 2016 5:11 pm

SIMPLE Loading Screen?

Post by Greninjask »

First time poster here,

I have a good prototype for my game, and I'm testing it out on mobile. Unfortunately (at least with my Android phone) there is a 3-4 second loading time, and during this time, the screen is just black. Is there a way for me to add a simple loading screen during this short interval? All I really want to do is just display the text "Loading, please wait", or maybe an image, so the user would know that the app is actually doing something instead of just staring at an empty screen.

Thanks in advanced for any help!
User avatar
ivan
Party member
Posts: 1915
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: SIMPLE Loading Screen?

Post by ivan »

The way I approach this is by displaying a splash screen.
Basically I draw an image, then I load fonts, lua files and sfx.
One everything is loaded up, I do a transition effect.

The loading routine could be simplified to:

Code: Select all

local queue = { "1.lua", "2.lua", "3.lua" }
function love.update(dt)
  local q = table.remove(queue)
  if q == nil then
     return -- done loading
  end
  -- if _ext == '.lua' then
    dofile(q)
  -- end
end
PS. Sure you can use threads but what's the point if you're splash screen is static?
User avatar
pgimeno
Party member
Posts: 3656
Joined: Sun Oct 18, 2015 2:58 pm

Re: SIMPLE Loading Screen?

Post by pgimeno »

You can also draw something in love.load (or even in main, before any requires) and then call love.graphics.present() before you start loading other things. I think you need to call love.graphics.clear() before drawing anything.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 4 guests