1
public EngineOptions onCreateEngineOptions() {
    instance = this;
    mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);

    return new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED,
            new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), mCamera)).setNeedsSounds(true);
}

サウンドの有効化中にエラーを表示するエラーを表示するメソッドsetNeedsSound(boolean)は、タイプEngineOptionsに対して未定義です。

また試した

return new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED,
                new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), mCamera)).getAudioOptions().setNeedsSound(true);

ただし、エラータイプの不一致が表示されます:AudioOptionsからEngineOptionsに変換できません

4

2 に答える 2

0

この方法で試してください

final EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED,
            new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), mCamera);
    engineOptions.getAudioOptions().setNeedsSound(true);
    engineOptions.getAudioOptions().setNeedsMusic(true);
于 2012-09-27T12:44:00.323 に答える
0

コードに余分なものがあるよう)です。試す:

return new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), mCamera).setNeedsSounds(true);
于 2012-09-27T12:46:12.763 に答える