How do I add a delay between that the default.png turns up and that the app starts? [import]uid: 24111 topic_id: 6087 reply_id: 306087[/import]
easiest way I guess is to skip the default splash and create your own routine with a timer. Search the forum for a post by Carlos. I think you will find it by searching for splashscreen [import]uid: 22737 topic_id: 6087 reply_id: 20854[/import]
Similar to what akviby says, but slightly different:
What I did was create a splash.lua file that has an identical background image as the Default.png.
Inside the splash.lua, I use a timer to wait an additional 2 seconds before continuing on to the main page.
That way it looks pretty close to a seemless image. It’s a good idea to have a Default.png because it iOS will load it immediately for display, as your app is getting ready for load. If you don’t have a Default.png, it will show a black screen (not ideal).
module(..., package.seeall)
function new()
local localGroup = display.newGroup()
local splashimg = display.newImageRect("Default.png",320,480,true)
splashimg.x = display.contentWidth\*0.5
splashimg.y = display.contentHeight\*0.5
localGroup:insert(splashimg)
local handle
local function waitAndSwitch()
timer.cancel(handle)
director:changeScene("main","fade")
end
handle = timer.performWithDelay(1000,waitAndSwitch)
return localGroup
end
[import]uid: 22457 topic_id: 6087 reply_id: 20863[/import]