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)