Cocos2d Engine - Pause , resume

后端 未结 3 1059
再見小時候
再見小時候 2021-02-10 18:51

I have a game scene which has 2 layers as shown below , when the user taps the Pause button am adding a Pause window layer as a child to Status bar layer. Game is in progress so

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-10 19:08

    You can enable and disable touch like this :

    Disable touch before pause :

    [self setIsTouchEnabled:NO] 
    

    Enable again after resume :

    [self setIsTouchEnabled:YES]
    

    In cocos2d-x

    this->setTouchEnabled(false);
    

提交回复
热议问题