How to create android cocos2dx splash screen?

前端 未结 4 772
余生分开走
余生分开走 2021-01-15 17:27

This is my code I don\'t know how to create splash screen and how it will direct in my menu screen. All .h must be connected to BaseScreen and the BaseScreen will be the one

4条回答
  •  余生分开走
    2021-01-15 18:00

    I am using the scheduleOnce function.

    void Splash::onEnter(){
        CCLayer::onEnter();
        CCLog("onEnter");
        this->scheduleOnce(schedule_selector(Splash::finishSplash),2.0f);
    }
    
    void Splash::finishSplash(float dt){
        CCDirector::sharedDirector()->replaceScene(GameWall::scene());
    }
    

    after 2 seconds, finish the splash screen and start GameWall Screen. That's all I have done.

提交回复
热议问题