Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

show/hide overlay not working properly
Started by 15Nova22 May 04 2019 08:34 AM

2 replies to this topic
corona composer overlay

Best Answer Gab at Revoludo , 09 May 2019 - 12:09 PM

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!

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

15Nova22

[GLOBAL: userInfoPane.html]
15Nova22
  • Observer

  • 2 posts
  • Corona SDK

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?



[TOPIC: post.html]
#2

Gab at Revoludo

[GLOBAL: userInfoPane.html]
Gab at Revoludo
  • Observer

  • 2 posts
  • Corona SDK

  Best Answer

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!


  • 15Nova22 likes this

[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,660 posts
  • Enterprise

@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


  • 15Nova22 likes this


[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: corona, composer, overlay