Scene transition with delay

  • webkuk
    Likes 0

    Problem Description

    var SplashScene = cc.Scene.extend({

        onEnter: function() {

            this._super();

            splashAction = new cc.Sequence([cc.DelayTime(15),cc.CallFunc(cc.director.runScene(new cc.TransitionTurnOffTiles(1,new MenuScene())))]);

            this.runAction(splashAction);

        }

    });

    i think this code do 15 sec delay and after this do transition. But delay dont work. Where is my problem?

  • Sonar Systems admin
    Likes 0

    Have you tried the delay but instead of CallFunc just do a random action to see if it works.

  • webkuk
    Likes 0

    How it work cc.Sequence([A,B,C])?

    after finished A action start B action?


  • Sonar Systems admin
    Likes 0

    Check out the link below and look at the last few actions.

    http://cocos.sonarlearning.co.uk/v1.0/docs/actions

  • webkuk
    Likes 0

    i read it, but i understand why my code not work. can u write for me example sequence with 15 sec delay and after this transition on anoither scene?

  • Sonar Systems admin
    Likes 0

    Trying scheduling multiple methods to do each task. The next method is called at the end of the previous tasks method.

  • webkuk
    Likes 1

    I did it!

    var SplashScene = cc.Scene.extend({

        ctor: function() {

            this._super();

            this.runAction(cc.sequence(cc.delayTime(5),cc.callFunc(this.gotoMenu)));

        },

        gotoMenu: function(){

            cc.director.runScene(new cc.TransitionTurnOffTiles(1,new MenuScene()));

        }

    });

  • Sonar Systems admin
    Likes 0

    GREAT TO HEAR :D

Login to reply