Composer: "did" phase for hide events firing too soon on crossFade

I’m using composer to transition between scenes, and I’m retrofitting it to an old project. One thing I’ve noticed is that on some transitions, display items are being deleted while they are still on screen, so they visually pop out of existence which looks awful. I’m trying to figure out if it’s a bug with composer or (more likely) something I’m doing wrong.

Here’s my abridged code:

[lua]

local composer = require “composer”

local game=require “game”

local scene = composer.newScene()

local gameInstance

function scene:show(event)

    if event.phase==“will” then

        gameInstance=game.start()

        self.view:insert(gameInstance)

    end

end

function scene:hide(event)

    if event.phase==“did” then

        gameInstance:removeSelf()

    end

end

scene:addEventListener(“create”, scene)

scene:addEventListener(“show”, scene)

scene:addEventListener(“hide”, scene)

return scene

[/lua]

In game.lua I then call the following when I want to exit the above scene:

[lua]

composer.gotoScene(“scenes.map”,{

      effect = “crossFade”,

      time = 500

    })

[/lua]

So the issue is that the line gameInstance:removeSelf is being called while the gameInstance display group is still visible. It’s fixable using a timer to delay the call, but based on that composer call, I would expect all items to have faded out by the time the event is called. Has anyone else had any issues with this or know what might be causing this problem?

Hmmm… I’ve tried a few other transitions like “fade” and “flipFadeOutIn” and they have worked fine. It seems to be an issue with the “crossFade” transition.

Bug report submitted

Yeah I’m seeing the same issue tap32. It would appear (visually anyway) that “did” is firing before “will” on scene:hide(), which is specifically noticeable because if you crossfade and destroy the scene on “did” the screen goes black, but on “will” it does not.

Hmmm… I’ve tried a few other transitions like “fade” and “flipFadeOutIn” and they have worked fine. It seems to be an issue with the “crossFade” transition.

Bug report submitted

Yeah I’m seeing the same issue tap32. It would appear (visually anyway) that “did” is firing before “will” on scene:hide(), which is specifically noticeable because if you crossfade and destroy the scene on “did” the screen goes black, but on “will” it does not.

Is there any update on this bug? I’m experiencing this too with “fromLeft” and most others.

“did” fires at the same time as “will” instead of when the new scene is done transitioning in.

Not heard anything back on the bug report I submitted

Is there any update on this bug? I’m experiencing this too with “fromLeft” and most others.

“did” fires at the same time as “will” instead of when the new scene is done transitioning in.

Not heard anything back on the bug report I submitted

any news?

any news?