show/hide overlay not working properly

Hi there I have a problem with the hideOverlay and showOverlay functionalities. 

This is my code inside a EventListener callback for a button that gets executed on tap

function openOverlay() composer.showOverlay("levels.ability\_overlay", { isModal = true, effect = "fade", time = 400 }) end

I get the overlay with that, but it´s neither model nor using the effect, so that´s my first problem.

The second problem is that the following is not closing the Overlay:

 local function backToGame() print("There") composer.hideOverlay("fade", 400) end

this one is a EventListener callback in the Overlay itself. I also tried calling it via a function in the main scene but that didn´t worked either.

Any Ideas what I´m doing wrong here?

I had a similar issue and found your thread trying to fix it. Hopefully your problem is as simple as mine.

My problem was: I forgot to insert my display elements into the display group (sceneGroup)

Your code above doesn’t include any visual. I’m guessing you do have visuals to apply the effect to.

If you don’t insert them in the sceneGroup, the composer cannot apply transition effect to the display elements. 

Same thing with hideOverlay(). The composer is hiding/removing/recycling the sceneGroup. So if your display stuff is not in the sceneGroup, they will stay on screen even if you hide the overlay.

Hope that helps!

@Gab at Revoludo is likely right. If you’re not adding your images into the group managed by Composer, composer just won’t work.

But without sharing how you’re creating your overlay scene, it’s going to be hard to advise you.

Rob

I had a similar issue and found your thread trying to fix it. Hopefully your problem is as simple as mine.

My problem was: I forgot to insert my display elements into the display group (sceneGroup)

Your code above doesn’t include any visual. I’m guessing you do have visuals to apply the effect to.

If you don’t insert them in the sceneGroup, the composer cannot apply transition effect to the display elements. 

Same thing with hideOverlay(). The composer is hiding/removing/recycling the sceneGroup. So if your display stuff is not in the sceneGroup, they will stay on screen even if you hide the overlay.

Hope that helps!

@Gab at Revoludo is likely right. If you’re not adding your images into the group managed by Composer, composer just won’t work.

But without sharing how you’re creating your overlay scene, it’s going to be hard to advise you.

Rob