Ejemplo n.º 1
0
 public EngineOptions onCreateEngineOptions() {
   camera = new BoundCamera(0, 0, 680, 1200);
   EngineOptions engineOptions =
       new EngineOptions(
           true, ScreenOrientation.PORTRAIT_FIXED, new FillResolutionPolicy(), this.camera);
   engineOptions.getAudioOptions().setNeedsMusic(true).setNeedsSound(true);
   engineOptions.getRenderOptions().getConfigChooserOptions().setRequestedMultiSampling(true);
   engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON);
   return engineOptions;
 }
Ejemplo n.º 2
0
 @Override
 public EngineOptions onCreateEngineOptions() {
   this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
   EngineOptions options =
       new EngineOptions(
           true, ScreenOrientation.LANDSCAPE_FIXED, new FillResolutionPolicy(), mCamera);
   options.getAudioOptions().setNeedsMusic(true).setNeedsSound(true);
   options.setWakeLockOptions(WakeLockOptions.SCREEN_ON);
   return options;
 }
 // ====================================================
 // CREATE ENGINE OPTIONS
 // ====================================================
 @Override
 public EngineOptions onCreateEngineOptions() {
   EngineOptions engineOptions =
       new EngineOptions(
           true,
           ScreenOrientation.LANDSCAPE_SENSOR,
           new FillResolutionPolicy(),
           new Camera(0, 0, cameraWidth, cameraHeight));
   engineOptions.getRenderOptions().setDithering(true);
   engineOptions.getRenderOptions().getConfigChooserOptions().setRequestedMultiSampling(true);
   engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON);
   return engineOptions;
 }
Ejemplo n.º 4
0
  /**
   * Defines the options of the engine, such as the type of camera and screen orientation
   *
   * @return
   */
  @Override
  public EngineOptions onCreateEngineOptions() {
    smoothCamera =
        new SmoothCamera(
            0, 0, CAMERA_WIDTH, CAMERA_HEIGHT, maxVelocityX, maxVelocityY, maxZoomFactorChange);
    smoothCamera.setBounds(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
    smoothCamera.setBoundsEnabled(true);
    IResolutionPolicy resolutionPolicy = new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT);
    EngineOptions engineOptions =
        new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, resolutionPolicy, smoothCamera);
    engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON);
    engineOptions.getTouchOptions().setNeedsMultiTouch(true);

    // Check for MultiTouch support
    if (!MultiTouch.isSupported(this)) {
      Toast.makeText(
              this, getResources().getString(R.string.multitouch_support), Toast.LENGTH_SHORT)
          .show();
      finish();
    }
    return engineOptions;
  }