Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
A simple question about scene manager... — Gideros Forum

A simple question about scene manager...

Tom2012Tom2012 Guru
edited December 2012 in General questions
I've been using Scene Manager for some time without problems.

But I have a character walks into a door and then this calls:

sceneManager:changeScene("Level Complete", 0, SceneManager.flipWithFade, easing.outBack);

I have a test print statement in there too. The odd thing is that even after the scene has changed, the print statement keeps printing.

Now I'm wondering if I have to do anything with scene manager to REMOVE the previous scene?

Hope that makes sense!

Thank you

Comments

  • ar2rsawseenar2rsawseen Maintainer
    edited December 2012
    @Tom2012 now there's nothing you need to do with SceneManager additionally ;)

    But what you can do, is to ensure that you call scene transition only once. Simply set up a global variable/class property and then check
    if not self.changing then
        self.changing = true
        sceneManager:changeScene("Level Complete", 0, SceneManager.flipWithFade, easing.outBack)
    end
    I think the problem might be, that if you check on collision, then collision is continious and you end up changing scene many times, which gets stack up somewhere in Lua VM and is keep calling even after scene has already changed.

    P.S.
    This almost sound like a bar joke:

    a character walks into a door and then calls:
  • @ar2rsawseen I've also been using SceneManager for sometime. I've been wondering, what is the easing.lua file have to do with SceneManager? I can't find any difference with/without it so I just deleted it. Is there an advantage to using it?

    Thanks!
    -Landon
    JLS
    Lead Coder and Designer
  • Easing functions control the speed of transition in different time points and even more, provides other effects, as bouncing etc.

    Here is a visualization of easing functions:
    http://easings.net/

    But yes, that's completely optional and you may delete it if you don't use it ;)
  • @ar2rsawseen

    Ah, that's exactly what's happening. And your solution solved the problem. Was just worried I had completely misunderstood how scene manager worked.

    Thank you as always.

    LOL @ the joke bit and... you asked for it...

    Past, present and future walked into a bar... It was tense!
Sign In or Register to comment.