Tag: Flowchart
Cocos2dx in Multi-scenario switching, the effect of lifecycle printing is as follows:
Start from the myscene scenario, switch to the helloworld scenario, and then launch the helloworld scenario and flowchart (see attachment,. I don't know how to upload images, but I can't paste images, so I'm depressed ...)
Print the following log,
Myscene code: myscene () {cclog ("wangss -----------> myscene");} myscene ::~ Myscene () {cclog ("wangss -------------> ~~ Myscene ");} void myscene: onenter () {cclog (" wangss -----------> onenter "); layer: onenter ();} void myscene: onentertransitiondidfinish () {cclog ("wangss -----------> onentertransitiondidfinish");} void myscene: onexit () {cclog ("wangss -------------> onexit"); layer: onexit ();} void myscene: onexittransitiondidstart () {cclog ("wangss -------------> onexittransitiondidstart");} void myscene: cleanup () {cclog ("Wan GSS -------------> cleanup ");} SCENE * myscene: createscene () {cclog (" wangss -------------> createscene "); Auto scene = scene: Create (); auto layer = myscene: Create (); scene-> addchild (layer); Return scene;} bool myscene: Init () {cclog ("wangss -------------> init "); if (! Layer: Init () {return false;} size visiblesize = Director: getinstance ()-> getvisiblesize (); vec2 origin = Director: getinstance () -> getvisibleorigin (); // spritetest (visiblesize); // labeltest (visiblesize); // menutest (visiblesize); // receivagetest (visiblesize ); // scheduletest (visiblesize); // scaleninespritetest (visiblesize); // shujujiegoutest (visiblesize); // actiontest (visiblesize); // actioncallbacktest (Visiblesize); // frameanimationtest (visiblesize); // actioneasetest (visiblesize); // progressactiontest (visiblesize); merge (visiblesize); Return true;} helloworld code: helloworld :: helloworld () {cclog ("wangss ------ helloworld -------> helloworld");} helloworld ::~ Helloworld () {cclog ("wangss ------ helloworld -------> ~~ Helloworld ");} void helloworld: onenter () {cclog (" wangss ------ helloworld -------> onenter "); layer: onenter ();} void helloworld: onentertransitiondidfinish () {cclog ("wangss ------ helloworld -------> onentertransitiondidfinish");} void helloworld: onexit () {cclog ("wangss ------ helloworld -------> onexit"); layer :: onexit ();} void helloworld: onexittransitiondidstart () {cclog ("wangss ------ helloworld -------> onexittransitiondidstart");} void helloworld: cleanup () {cclog ("wangss ------ helloworld -------> cleanup");} SCENE * helloworld: createscene () {cclog ("wangss ------ helloworld -------> createscene "); // 'Scene 'is an autorelease object auto scene = scene: Create (); // 'player' is an autorelease object auto layer = helloworld: Create (); // Add layer as a child to scene-> addchild (layer); // return the scene return scene ;}
11-02 15:09:40. 290: D/cocos2d-x debug info (23066): wangss -------------> createscene
11-02 15:09:40. 300: D/cocos2d-x debug info (23066): wangss -------------> myscene
11-02 15:09:40. 300: D/cocos2d-x debug info (23066): wangss -------------> init
11-02 15:09:40. 320: D/cocos2d-x debug info (23066): wangss -------------> onenter
11-02 15:09:40. 320: D/cocos2d-x debug info (23066): wangss -------------> onentertransitiondidfinish
11-02 15:09:43. 640: D/cocos2d-x debug info (23066): wangss ------ helloworld -------> createscene
11-02 15:09:43. 640: D/cocos2d-x debug info (23066): wangss ------ helloworld -------> helloworld
11-02 15:09:43. 640: D/cocos2d-x debug info (23066): wangss ------ helloworld -------> init
11-02 15:09:43. 760: D/cocos2d-x debug info (23066): wangss -------------> onexittransitiondidstart
11-02 15:09:43. 760: D/cocos2d-x debug info (23066): wangss ------ helloworld -------> onenter
11-02 15:09:44. 940: D/cocos2d-x debug info (23066): wangss -------------> onexit
11-02 15:09:44. 940: D/cocos2d-x debug info (23066): wangss ------ helloworld -------> onentertransitiondidfinish
11-02 15:09:44. 940: D/cocos2d-x debug info (23066): wangss -------------> cleanup
11-02 15:09:44. 940: D/cocos2d-x debug info (23066): wangss -------------> ~~ Myscene
11-02 15:09:46. 220: D/cocos2d-x debug info (23066): wangss ------ helloworld -------> onexit
11-02 15:09:46. 220: D/cocos2d-x debug info (23066): wangss ------ helloworld -------> cleanup
11-02 15:09:46. 220: D/cocos2d-x debug info (23066): wangss ------ helloworld -------> ~~ Helloworld
Cocos2dx scene Life Cycle (replacescene, popscene will be supplemented later)