Transition to Current Scene Not Working

Hi,

I’m using composer to manage my scenes for my game.  At the end of each level (game.lua) I display an overlay with a “continue” button (popup.lua).

I want to hide the overlay, then transition to game.lua with a slideLeft effect.  However, this does not work:

composer.hideOverlay()

composer.gotoScene(“scenes.game”, {effect = “slideLeft”})

I see other people have asked this question before (e.g. https://forums.coronalabs.com/topic/65598-problem-restarting-a-scene/), but it’s usually in conjunction with a bunch of other questions and has gone unanswered - or the answers are old.

I’m currently developing using an old version of the Corona Simulator (Version 2015.2731 (2015.10.5)), so I’m wondering:

  1. has this issue been fixed if I upgrade? or
  2. if not, then how can I achieve the effect I want?  (deleting and reloading the entire scene seems like an extremely inefficient option - and I’ve structured my code in such a way to avoid this).

Thanks!

You’re trying to transition from game.lua to game.lua, by the looks of it. This wont work. You can reload the same scene, but not with transitions. Transitions will only work moving between two different scenes. ie, if you present a gameover.lua and transition back to game.lua from there, that would work.

Thanks for the reply.  Yes, that’s correct - so is there a way to achieve the effect I want?

You need a cut-scene. You can’t transition what’s already on screen with out another scene to replace it with. Now you could, when your scene hides, take a screen capture, then put some transition on the display object from the screen capture to give the illusion of a transition.

Rob

You’re trying to transition from game.lua to game.lua, by the looks of it. This wont work. You can reload the same scene, but not with transitions. Transitions will only work moving between two different scenes. ie, if you present a gameover.lua and transition back to game.lua from there, that would work.

Thanks for the reply.  Yes, that’s correct - so is there a way to achieve the effect I want?

You need a cut-scene. You can’t transition what’s already on screen with out another scene to replace it with. Now you could, when your scene hides, take a screen capture, then put some transition on the display object from the screen capture to give the illusion of a transition.

Rob