I downloaded a very cool scene management code package that you have here on the site.
He makes the transitions and everything etc ...
But during the tests with the games here I realized that even when you change the scene, the previous scene (and what you have in ENTER_FRAME of it) continues to run. Does the scene manager remove only visually?
Is there a right way or command to permanently remove the previous Sprite / Scene?
Code in main.lua
GerenciadorCenas = SceneManager.new({
--Cena inicial
["cSplashScreen"] = cSplashScreen,
["cHome"] = cHome,
["cFase1"] = cFase1,
--["cOpcoes"] = cOpcoes
}) |
Code call other scene:
bHome:addEventListener("click",
function()
sounds:play("hit")
GerenciadorCenas:changeScene("cHome", 1, GerenciadorCenas.fade)
end) |
Or did I get it wrong and this Scene Manager always leaves all scenes on?
Comments
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
Likes: antix
https://deluxepixel.com
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
Likes: SinisterSoft
if you disable ENTER_FRAME right away, there are no such problems
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
Likes: oleg
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
But it really depends on the game. I was just showing that there are some built-in events that can be used to turn things on/off at the correct time.
Likes: oleg
https://deluxepixel.com
@oleg and @SinisterSoft Thank you for your help. I got it and I'm doing tests here.
Likes: SinisterSoft, antix
He continues to run the event for a while before stopping.
See below:
There are two scenes, one called Menu1 and the other called Game1.
Each has a button with the function of loading the other scene and an ENTER_FRAME containing a print that identifies the scene and counts.
Edit: Does it continue to run the event because while it is giving the transition effect the scene is still active?
Edit 2: I failed miserably.
Enterframe events continue to run even by placing the suggested codes.
Too bad I do not have the competence to use something that is already ready and works for everyone.
I've been messing around for 6 hours and nothing. Failure
Jogo1.lua
Likes: kinrpg
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
Likes: kinrpg
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!
Thanks for the help, I used the code the way you showed me and now the events are being eliminated correctly along with the sprites.
Sorry for the delay in giving feedback but I had to work with other things and I only got back on the pc today.
Likes: antix
Likes: kinrpg, MoKaLux
https://play.google.com/store/apps/developer?id=razorback456
мій блог по гідерос https://simartinfo.blogspot.com
Слава Україні!