Default*.png Doesn't Match Up In Simulator When Trying To Transition To First Real Scene

I was trying to get my Default*.png splash screen that loads up with the app to transition to the first scene in my app.  I kept tweaking the images scales until I thought I got it right, but it appears that the Simulator is either not displaying the proper image or the correct dimensions, which drove me crazy when I actually tested it on the device.

So, even though the code below works perfectly below on the device (tested on iPhone 5 and iPad mini so far), it’ll look wrong in the Simulator.

Can Corona look into it so it’s properly using the right Default*.png file in the proper scaling in the Simulator?

Assuming the below  config.lua file:

application = { content = { width = 320, height = 480, scale = "zoomEven", fps = 60, imageSuffix = { ["@1-5"] = 1.5, -- for Droid, Nexus One, etc. ["@2x"] = 2, -- for iPhone 4/4S, iPod touch 4G, iPad1, and iPad2 ["@3x"] = 3, -- for various mid-size Android tablets ["@4x"] = 4, -- for iPad 3 } }, }

And assuming my own iOSinfo function in Code Exchange to detect the device:

local splashscreen if string.match( iOSinfo( "real" ), "iPad" ) then splashscreen = display.newImageRect( "Default-Landscape.png", 512, 384 ) splashscreen:scale( 0.8325, 0.835 ) else if iOSinfo( "wide" ) then splashscreen = display.newImageRect( "Default-568h@2x.png", 320, 568 ) splashscreen:scale( 0.845, 0.845 ) else splashscreen = display.newImageRect( "Default.png", 320, 480 ) splashscreen:scale( 1, 1 ) splashscreen.x, splashscreen.y = display.contentCenterX, display.contentCenterY end splashscreen.rotation = 90 end splashscreen.x, splashscreen.y = display.contentCenterX, display.contentCenterY

Lastly, make sure the following files exist:

Default.png (320x480 non-Retina iPhone portrait)

Default@2x.png (640x960 Retina iPhone portrait)

Default-Landscape.png (1024x768 non-Retina iPad landscape)

Default-Landscape@2x.png (2048x1536 Retina iPad landscape)

Default-568h@2x.png (640x1136 Retina iPhone portrait)

Hi @BeyondtheTech,

Pardon me for asking a (probably) stupid question, but why aren’t you just including the proper splash screen files in your project directory and letting the OS handle them automatically? I haven’t seen this “function” way of handling it before, so I’m curious why you’re doing it this way… there must be a specific reason, yes?

Brent

The above Default*.png files are there in my binary normally for iOS to display upon launching the app.  It’s when iOS finishes loading the app and passes control over to the Corona engine. I want to transition that splash screen into the first scene of the game.

By default, Corona paints the screen black/blank, so what I do to make it seamless is quickly flash up the same splash image onto the screen, then I can fade or manipulate the image as I see fit.

The problem is maybe because of my config.lua file, the app thinks it’s in 480x320 mode, so when I load the appropriate image (based on the device), scale, and position it, it requires additional tweaking.  I think I’ve nailed it on the device after realizing what the Simulator was throwing up there was wrong (I had totally different values).

http://www.youtube.com/watch?v=-ymsWQL_YNc

I know exactly where you are coming from but it’s not as much of a problem on device, it seems to just be ugly in the simulator.  How important of a feature is this for us to chase?

Low priority, don’t sweat it then. I’m just glad to have figured it out and shared the info here, in case others wanted to do the same, just so they don’t go crazy when the Simulator differs from actual device output.

On a sidenote, any reason why the YouTube embeds don’t appear in the iPhone version of the forums?

Thanks again.

Hi @BeyondtheTech,

Pardon me for asking a (probably) stupid question, but why aren’t you just including the proper splash screen files in your project directory and letting the OS handle them automatically? I haven’t seen this “function” way of handling it before, so I’m curious why you’re doing it this way… there must be a specific reason, yes?

Brent

The above Default*.png files are there in my binary normally for iOS to display upon launching the app.  It’s when iOS finishes loading the app and passes control over to the Corona engine. I want to transition that splash screen into the first scene of the game.

By default, Corona paints the screen black/blank, so what I do to make it seamless is quickly flash up the same splash image onto the screen, then I can fade or manipulate the image as I see fit.

The problem is maybe because of my config.lua file, the app thinks it’s in 480x320 mode, so when I load the appropriate image (based on the device), scale, and position it, it requires additional tweaking.  I think I’ve nailed it on the device after realizing what the Simulator was throwing up there was wrong (I had totally different values).

http://www.youtube.com/watch?v=-ymsWQL_YNc

I know exactly where you are coming from but it’s not as much of a problem on device, it seems to just be ugly in the simulator.  How important of a feature is this for us to chase?

Low priority, don’t sweat it then. I’m just glad to have figured it out and shared the info here, in case others wanted to do the same, just so they don’t go crazy when the Simulator differs from actual device output.

On a sidenote, any reason why the YouTube embeds don’t appear in the iPhone version of the forums?

Thanks again.

Where is the “Default.png” actually discussed in on the docs?

How can you determine how long it’s been up and if you need to add delays to allow more visibility?

I wrote one myself that uses transitions to delay and fade away, but that only works after the app starts.

I looked all over for “splash screen” before and didn’t see anything. Is this new and undocumented?

Thanks!
Stu

Hi Stu,

The “Default.png” file or “launch image” has been documented for quite some time (I can’t remember how long, but as long as I remember). It was discussed in the older guide on configuring a project, but more recently it was added to the updated guide here, under “Launch Images”:

http://docs.coronalabs.com/guide/distribution/buildSettings/index.html

Best regards,

Brent

Could someone stuff "splash screen in the document so that searches for splash screens finds Launch Images?

Being as close as I am to NASA, I would assume a launch image is one taken during or after a launch.

I added this to the code before the start of my visible code to make sure it delayed long enough for the user to “see” the splash page, if it is being run on a faster processor. We had to tie stuff to “time” so that time delays didn’t change when the  turbo button was in or out in early PC’s… most of you today have no idea of a turbo button…

while &nbsp;(system.getTimer() \< 4000) do end &nbsp; &nbsp; &nbsp; &nbsp;-- make sure splash screen is visible &nbsp;

Who knows, there may be a better way.

Thanks!
Stu

Hi Stu,

“Being as close as I am to NASA, I would assume a launch image is one taken during or after a launch.”

That’s funny… and pretty accurate too. :slight_smile:

I added “splash screen” into the guide, but no guarantees how soon (or even if) the search engines will recognize it. Fingers crossed…

Brent

Where is the “Default.png” actually discussed in on the docs?

How can you determine how long it’s been up and if you need to add delays to allow more visibility?

I wrote one myself that uses transitions to delay and fade away, but that only works after the app starts.

I looked all over for “splash screen” before and didn’t see anything. Is this new and undocumented?

Thanks!
Stu

Hi Stu,

The “Default.png” file or “launch image” has been documented for quite some time (I can’t remember how long, but as long as I remember). It was discussed in the older guide on configuring a project, but more recently it was added to the updated guide here, under “Launch Images”:

http://docs.coronalabs.com/guide/distribution/buildSettings/index.html

Best regards,

Brent

Could someone stuff "splash screen in the document so that searches for splash screens finds Launch Images?

Being as close as I am to NASA, I would assume a launch image is one taken during or after a launch.

I added this to the code before the start of my visible code to make sure it delayed long enough for the user to “see” the splash page, if it is being run on a faster processor. We had to tie stuff to “time” so that time delays didn’t change when the  turbo button was in or out in early PC’s… most of you today have no idea of a turbo button…

while &nbsp;(system.getTimer() \< 4000) do end &nbsp; &nbsp; &nbsp; &nbsp;-- make sure splash screen is visible &nbsp;

Who knows, there may be a better way.

Thanks!
Stu

Hi Stu,

“Being as close as I am to NASA, I would assume a launch image is one taken during or after a launch.”

That’s funny… and pretty accurate too. :slight_smile:

I added “splash screen” into the guide, but no guarantees how soon (or even if) the search engines will recognize it. Fingers crossed…

Brent