开发者

Background Music Toggle (cocos2d iPhone) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.

Wan开发者_开发知识库t to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 4 years ago.

Improve this question

I started making a toggle in my Settings scene for background music on/off. I'm not sure how to make this toggle only for background music, since I also have other effects and such in my game. How do I make the toggle only affect the background music in my app?


I have already done so, maybe give some to you!

- (void)muteMusic:(CCMenuItemToggle *)sender
{
    if([[SimpleAudioEngine sharedEngine]isBackgroundMusicPlaying])
    {
        [[SimpleAudioEngine sharedEngine] pauseBackgroundMusic];
    } else {
        [[SimpleAudioEngine sharedEngine] resumeBackgroundMusic];
    }

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜