Help! How to tell when Corona Labs launch image has dissappeared?

First, this is borderline slipping off topic. Lets try to stay focused on the immediate issue.

Most users shouldn’t be interacting with the game until they see the UI and know what they are interacting with. If the splash screen is staying on screen too long, based on @Vlads’s description of what should happen, it could be a case of doing too much in main.lua before the enterFrame listener fires up. It’s very likely that depending on the device, those touch/tap events may get queued up and passed on to objects.

You can attempt to consume taps until you’re ready by creating a full screen rectangle. It can be invisibile, but set .isHitTestable to true so you can put a touch and tap listener on that rect and throw away any touches until you’re ready. Maybe set a short timer, like 17ms (to get into the second frame) and remove the blocker object. Maybe make it the last line of main.lua and not mess with timers.

All bugs are important to the person experiencing them but given how little this problem has occurred over the years and the importance of the other things we are working on, this is likely something that someone could tackle through the open source code and make a pull request.

Rob
 

Well, to those who are using the splash screen plugin, I would recommend the following workaround until someone tackles the source of the problem.

The splash screen lasts ~1.5 seconds and this starts pretty much the same time as your main.lua begins to run. So, in order to prevent the player from tapping anything OR to actually prevent the game from running for one and a half seconds until it should, you just need to wait out the splash screen in your main.lua file and then move on, i.e.

main.lua:

local composer = require("composer") -- go to the next scene as the splash screen is removed local function gotoScene() Runtime:removeEventListener( "system", onSystemEvent ) composer.gotoScene( "sceneName" ) end local sceneTimer = timer.performWithDelay( 1500, gotoScene ) -- pause the timer on application suspend (and resume it if needed) local function onSystemEvent( event ) if event.type == "applicationSuspend" then timer.pause( sceneTimer ) elseif event.type == "applicationResume" then timer.resume( sceneTimer ) end end Runtime:addEventListener( "system", onSystemEvent )

two seconds might be “safer” if you include the fade, but you could in theory recover some of that if you mimicked their logic:  grab the time at top of main, grab the time at bottom of main, subtract that elapsed from 2s, then delay for only that difference.  (as most non-trivial apps will consume at least some time in main, preloading and etcetera, to take advantage of some of that splash time already)

Rob, I hear what you are saying.

I don’t add listeners until the very end of main.lua and yet this issue still occurs. If there is some weirdness with timers hat I can exploit in a kludgey, indirect way to check for the presence of the splash screen I can experiment.

I think this is a worthy issue for utility or productivity apps that need to launch as soon as possible without superfluous time taken with intro splash and launch screen material. I wouldn’t want to inadvertently add to the already noticeable amount of time taken by the launch screen.

I would think the easiest fix, when and if time allows, is for the corona-provided splash screen to simply include a layer that traps touch events while the splash screen is present.

Corona is now a small company and they will not “fix” this issue.  There are far more time critical things they have to work on - like Android 64 bit

You need to use the work around we’ve given you and just pause your UI/UX for at least 2 seconds.

Note: Apart from certain system level events no runtime listeners should ever be instantiated in main anyway.