pause for 3 seconds

I am looking to show an image with text at the start of my apps loading, then proceed to menu. (like a splash screen) The only problem however is making the first screen last x amount of time before it calls  loadMenu() at the end of the function

any ideas?

-Paulo

@Paulo,

There are many ways to achieve this, but if you don’t want to use Storyboard or Director, you can make your own scene management code like this (very basic example):

-- Forward declare functions local doSplash local doMenu -- Define Functions Below doSplash = function()    local splashImage = display.newImageRect( ... fill in your own details )    local  function switchToMenu()       splashImage:removeSelf()       doMenu()    end    timer.performWithDelay( 3000, switchToMenu )     end doMenu = function()    -- Write code to make menu here end -- Run the code above doSplash() 

For some reason i tried timer.performWithDelay(3000,function) but it didn’t work in my code before… Now that i try it again, works flawlessly.

Thanks alot ! works like a charm

@Paulo,

There are many ways to achieve this, but if you don’t want to use Storyboard or Director, you can make your own scene management code like this (very basic example):

-- Forward declare functions local doSplash local doMenu -- Define Functions Below doSplash = function()    local splashImage = display.newImageRect( ... fill in your own details )    local  function switchToMenu()       splashImage:removeSelf()       doMenu()    end    timer.performWithDelay( 3000, switchToMenu )     end doMenu = function()    -- Write code to make menu here end -- Run the code above doSplash() 

For some reason i tried timer.performWithDelay(3000,function) but it didn’t work in my code before… Now that i try it again, works flawlessly.

Thanks alot ! works like a charm