I have a button widget to get me out of the menu to another scene (FYI: using Composer).
Here’s the function I use to go to the new scene:
local function GongBtn (event)
if event.phase == “ended” then
composer.loadScene( “gong”, false, options )
composer.gotoScene ( “gong”, { effect=“crossFade”, time=800 } )
end
end
If I touch the widget button twice before the “crossFade” effect has finished, the new scene quickly fades to a black screen with no way of getting out except reseting the simulator.
How do I prevent this black screen? For example, if a user accidentally touches the widgetButton a second time before the crossfade effect has finished.