Joshua,
I think I got to the problem - it seems that after overlayEnded event occurs no transitions are deployed from within button listeners. I tired to add this simple code to my button instead of my regular restartGame() function:
function button:tap() print("TAP TAP") local circleTrans1 local circleTrans2 local function makeCircle2() print("circle2 BEGIN") local circle2 = display.newCircle( \_W\*0.5, \_H\*0.5+30, 30 ) circle2.alpha = 0 local function nilOut() print("NIL BEGIN") transition.cancel(circleTrans1) transition.cancel(circleTrans2) circleTrans1 = nil circleTrans2 = nil end circleTrans2 = transition.to(circle2, { time = 500, alpha = 1, onComplete = nilOut }) end local circle = display.newCircle( \_W\*0.5, \_H\*0.5, 30 ) circle.alpha = 0 circleTrans1 = transition.to(circle, { time = 500, alpha = 1, onComplete = makeCircle2 }) end
So when I click the button after overlayEnded event occurred - I’m getting “TAP TAP” printed in the output but no visible circles, and no more print outputs. When I change circle.alpha = 1 and circle2.alpha = 1, then I’m getting “TAP TAP” output and one visible circle.
That means, that circleTrans1 transition isn’t deployed at all after overlayEnded event.
I tried to put the same code inside the scene:overlayEnded function and then the transition worked fine.
They are not deployed when they are triggered from inside button listeners.
Does it make any sense?