这个例子刚刚看了下没啥好说的。。就是7个button,每个button点击事件是一个音符。主要有个重要的就是有个预加载的代码
CocosDenshion::SimpleAudioEngine::sharedEngine()->preloadEffect(String::createWithFormat("%d.mp3",i)->getCString());
这样可以避免造成资源浪费。
如果预加载了退出程序后记得要释放加载,方法是unloadEffect。
这个例子刚刚看了下没啥好说的。。就是7个button,每个button点击事件是一个音符。主要有个重要的就是有个预加载的代码
CocosDenshion::SimpleAudioEngine::sharedEngine()->preloadEffect(String::createWithFormat("%d.mp3",i)->getCString());
这样可以避免造成资源浪费。
如果预加载了退出程序后记得要释放加载,方法是unloadEffect。