我正在使用 Andengine 开发游戏,我正在使用具有多个场景的 Base Game Activity
。我想在其中加载背景音乐。但是我不知道如何在使用Base Game Activity
时在引擎中启用声音。我在网络中找到了这段代码来启用声音。
返回新引擎(new EngineOptions(true, ScreenOrientation.LANDSCAPE, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), camera).setNeedsMusic(true));
但是这个是用onLoadScene()
编写的,我不知道如何在基础游戏actvity中实现onLoadScene()
。我可以重写onLoadScene()吗
在基本游戏 Activity 中或者是否有其他方法可以实现此目的,请帮助我...
任何建议对我来说都是有效的,并且感谢所有人......
最佳答案
尝试类似的事情
final EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED,
new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), mCamera);
engineOptions.getAudioOptions().setNeedsSound(true);
和/或
engineOptions.getAudioOptions().setNeedsMusic(true);
关于android - 如何在 Andengine 中的 Base Game Activity 上启用声音?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14405708/