本文整理汇总了Java中org.andengine.engine.options.EngineOptions.setWakeLockOptions方法的典型用法代码示例。如果您正苦于以下问题:Java EngineOptions.setWakeLockOptions方法的具体用法?Java EngineOptions.setWakeLockOptions怎么用?Java EngineOptions.setWakeLockOptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.andengine.engine.options.EngineOptions
的用法示例。
在下文中一共展示了EngineOptions.setWakeLockOptions方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateEngineOptions
import org.andengine.engine.options.EngineOptions; //导入方法依赖的package包/类
@Override
public EngineOptions onCreateEngineOptions() {
camera = new Camera(0, 0, Consts.SCREEN_HEIGHT, Consts.SCREEN_WIDTH);
EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED,
new RatioResolutionPolicy(Consts.SCREEN_HEIGHT, Consts.SCREEN_WIDTH), this.camera);
engineOptions.getAudioOptions().setNeedsMusic(true).setNeedsSound(true);
engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON);
return engineOptions;
}
示例2: onCreateEngineOptions
import org.andengine.engine.options.EngineOptions; //导入方法依赖的package包/类
@Override
public EngineOptions onCreateEngineOptions() {
prefs = PreferenceManager.getDefaultSharedPreferences(this);
camera = new FollowCamera(0, 0, Constants.CW, Constants.CH);
IResolutionPolicy resolutionPolicy = new FillResolutionPolicy();
EngineOptions engineOptions = new EngineOptions(true,
ScreenOrientation.PORTRAIT_FIXED, resolutionPolicy, camera);
engineOptions.getAudioOptions().setNeedsMusic(true).setNeedsSound(true);
engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON);
return engineOptions;
}
示例3: onCreateEngineOptions
import org.andengine.engine.options.EngineOptions; //导入方法依赖的package包/类
@Override
public EngineOptions onCreateEngineOptions() {
// Camera
mCamera = new Camera(0, 0, WIDTH, HEIGHT);
// Engine options
EngineOptions engineOptions = new EngineOptions(true,
ScreenOrientation.LANDSCAPE_FIXED, new RatioResolutionPolicy(RATIO), mCamera);
// Screen always turned on
engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON);
// Music
engineOptions.getAudioOptions().setNeedsMusic(true);
// Sound
engineOptions.getAudioOptions().setNeedsSound(true);
// Controls
if (android.os.Build.MANUFACTURER.equals("OUYA")){ //... Device is an OUYA...
NinjaTrials.OUYA_CONTROL = true;
OuyaController.init(this); // Necessary to listen for Ouya Controller's analogic events
}
else{ //... Device is something else...
NinjaTrials.OUYA_CONTROL = false;
}
// Return the engineOptions object, passing it to the engine
return engineOptions;
}
示例4: onCreateEngineOptions
import org.andengine.engine.options.EngineOptions; //导入方法依赖的package包/类
public EngineOptions onCreateEngineOptions()
{
camara = new Camera(0, 0, 480,800);// Pantalla fullHD? Mala suerte...
EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.PORTRAIT_FIXED, new RatioResolutionPolicy(480,800), this.camara);
// la RatioResolutionPolicy se encarga de añadir márgenes si fuese necesario para que la escena mantenga las proporciones.
//necesitamos sonido, internamente inicializa el player
engineOptions.getAudioOptions().setNeedsMusic(true).setNeedsSound(true);
engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON); // que no se apaque la pantalla cuando estamos jugando.
return engineOptions;
}
示例5: onCreateEngineOptions
import org.andengine.engine.options.EngineOptions; //导入方法依赖的package包/类
@Override
public EngineOptions onCreateEngineOptions()
{
camera = new BoundCamera(0, 0, 800, 480);
EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new FillResolutionPolicy(), camera);
engineOptions.getAudioOptions().setNeedsMusic(true).setNeedsSound(true);
engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON);
return engineOptions;
}