How to add a splash screen in Lua.
Hi All,
How can I add a fullscreen splash screen in my app. Currently I am doing this with the following code. But I am not sure about the way I do.
-------------------------------------------------------------------------------------------------
splashscreen = display.newImage( "images/default.png" );
local function removeSplash(event)
splashscreen:removeSelf()
splashscreen = nil
end
timer.performWithDelay(2000,removeSplash)
-------------------------------------------------------------------------------------------------
Using this code image is not cvering the whole screen. I appears only a portion of the screen only.
Is there any other way to display splash screen.
Please suggest...
Replies
You can see this post for splash screens:
http://developer.coronalabs.com/forum/2013/01/05/splash-screen-transition
For dealing with images that fill the whole screen you can have a look at this:
http://j.mp/GIZX4p
You can put the following images in the root folder.
Default.png
Default-Landscape.png
Default-LandscapeLeft.png
Default-LandscapeRight.png
Or...
Set you config.lua to "zoomStretch" and try
1 2 3 4 5 6 7 8 9 10 | splashscreen = display.newImage( "images/default.png", 0, 0, true ); splashscreen.x = display.contentCenterX splashscreen.y = display.contentCenterY local function removeSplash(event) splashscreen:removeSelf() splashscreen = nil end timer.performWithDelay(2000,removeSplash) |
This post (content-scaling-made-easy) is really helpful, search for The “magic recipe”. If you use this, you can set your config to "letterbox"
Hope some of this can help.


i would reccomend to take a look at the storyboard API and the Overlay function :)
http://developer.coronalabs.com/content/storyboard