Aug 172011
 

This tutorial will show you how to easily create a timed splash screen for your iPhone application.

I have had a few people ask me about this in the past and as the result of a recent request I have decided to finally write a little tutorial which shows you how to control how long your splash screen is shown for.

This tutorial assumes you are using director.

Step 1 - Open main.lua and put in the following line above your main function;

1
splash = display.newImage("Default.png")

Step 2 – Add these two lines within your main function;

1
2
splash:removeSelf()
splash = nil

Step 3 - Change main() (which appears at the end of your main.lua file when using director) to;

1
timer.performWithDelay(5000, main, 1)

And that’s it!

Your splash screen will show for an additional 5 seconds before you change to whatever scene/screen you have designated in your main() function, as per usual.

IMPORTANT!

It’s important to note that even if you have your status bar set to hidden in build.settings this will not be reflected in the Corona SDK simulator. Build for the Xcode simulator to see it properly. (In the simulator the status bar disappears only after the initial splash screen has disappeared, on device it will not be shown if your settings are correct.)

Enjoy!

Peach Pellen :)

PS – Have you liked Techority on Facebook yet? If not, please do so now using the widget on the right :)

Like this post? Subscribe to the monthly newsletter!

 

  6 Responses to “How To Use A Timed Splash Screen For Your App”

  1. You mention in a few of your tutorials (thank you btw for them) “This tutorial assumes you are using director.” what is Director?

  2. brill! exactly what i was looking for. thanks

  3. bamf strikes again.

  4. Cool little tutorial. It’s the kind of thing lots of folks want to do, but until you know how, you imagine all kinds of scary code is needed!

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.