reload scene with effects is not working

Hi,

I have a main scene called game. The first time i load that scene by using the following statement:

composer.gotoScene(“game”, {effect = “crossFade”, time=400}) 

and ir works fine.

However, if I try to reload that scene using a similar statement (with different effect value), the scene is loaded but the effect parameter is ignored.

What would be the best approach to reload a scene with an effect.

regards 

How many scenes do you have? Is it just a game.lua? Or like a menu then game then gameOver?

–SonicX278

Are you sure your effect is a valid one?

https://docs.coronalabs.com/api/library/composer/gotoScene.html#effects

  • Caleb

Hi, 

It’s just a game.lua. In that game.lua I define all functionality to load a new gametes everytime.

I’m using crossFade effect.

Thanks for your posts

Hi @oquesada,

Most likely, this is because you are reloading the same scene. Using various scene transition effects assumes that you are moving between scenes (from one scene to another), not simply reloading the same scene that you’re already in.

Of course, there are ways to handle this, for example you can remove the current scene entirely and then reload it… however, most often, game design (going back into the old days even) presents some kind of intermediate scene or overlay to the user before reloading the “active” scene. This could be a “you failed, try again!” kind of thing, a mini-menu, or something like that… basically, the idea is that the user gets an opportunity to continue playing OR exit to the main menu, change the difficulty setting, or whatever else makes sense for your design.

Hope this helps,

Brent

How many scenes do you have? Is it just a game.lua? Or like a menu then game then gameOver?

–SonicX278

Are you sure your effect is a valid one?

https://docs.coronalabs.com/api/library/composer/gotoScene.html#effects

  • Caleb

Hi, 

It’s just a game.lua. In that game.lua I define all functionality to load a new gametes everytime.

I’m using crossFade effect.

Thanks for your posts

Hi @oquesada,

Most likely, this is because you are reloading the same scene. Using various scene transition effects assumes that you are moving between scenes (from one scene to another), not simply reloading the same scene that you’re already in.

Of course, there are ways to handle this, for example you can remove the current scene entirely and then reload it… however, most often, game design (going back into the old days even) presents some kind of intermediate scene or overlay to the user before reloading the “active” scene. This could be a “you failed, try again!” kind of thing, a mini-menu, or something like that… basically, the idea is that the user gets an opportunity to continue playing OR exit to the main menu, change the difficulty setting, or whatever else makes sense for your design.

Hope this helps,

Brent