Esempio n. 1
0
  private void applyEngineOptions() {
    final EngineOptions engineOptions = this.mEngine.getEngineOptions();

    if (engineOptions.isFullscreen()) {
      // ActivityUtils.requestFullscreen(getActivity());
    }

    if (engineOptions.getAudioOptions().needsMusic()
        || engineOptions.getAudioOptions().needsSound()) {
      getActivity().setVolumeControlStream(AudioManager.STREAM_MUSIC);
    }

    switch (engineOptions.getScreenOrientation()) {
      case LANDSCAPE_FIXED:
        getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        break;
      case LANDSCAPE_SENSOR:
        if (SystemUtils.SDK_VERSION_GINGERBREAD_OR_LATER) {
          getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        } else {
          Debug.w(
              ScreenOrientation.class.getSimpleName()
                  + "."
                  + ScreenOrientation.LANDSCAPE_SENSOR
                  + " is not supported on this device. Falling back to "
                  + ScreenOrientation.class.getSimpleName()
                  + "."
                  + ScreenOrientation.LANDSCAPE_FIXED);
          getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        }
        break;
      case PORTRAIT_FIXED:
        getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        break;
      case PORTRAIT_SENSOR:
        if (SystemUtils.SDK_VERSION_GINGERBREAD_OR_LATER) {
          getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        } else {
          Debug.w(
              ScreenOrientation.class.getSimpleName()
                  + "."
                  + ScreenOrientation.PORTRAIT_SENSOR
                  + " is not supported on this device. Falling back to "
                  + ScreenOrientation.class.getSimpleName()
                  + "."
                  + ScreenOrientation.PORTRAIT_FIXED);
          getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        }
        break;
    }
  }
  public EngineOptions onCreateEngineOptions() {

    android.os.Debug.waitForDebugger();

    // Debug.setDebugLevel(DebugLevel.NONE);
    // Toast.makeText(this, "You move my sprite right round, right round...",
    // Toast.LENGTH_LONG).show();
    Debug.d("toast", "onCreateEngineOptions");

    final Camera camera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);

    EngineOptions options =
        new EngineOptions(
            true,
            ScreenOrientation.LANDSCAPE_FIXED,
            new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT),
            camera);
    // EngineOptions options = new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED, new
    // FillResolutionPolicy(), camera);
    options.getAudioOptions().setNeedsSound(true);
    options.getAudioOptions().setNeedsMusic(true);

    // getApplication().getWallpaperDesiredMinimumHeight()
    // DisplayMetrics metrics = getWindowManager().getDefaultDisplay().getMetrics(new
    // DisplayMetrics());

    return options;
  }
Esempio n. 3
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;
 }
Esempio n. 4
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;
 }
  // -----------------------------------------------------------------------//
  // Overloaded Methods                                                    //
  // -----------------------------------------------------------------------//
  @Override
  public EngineOptions onCreateEngineOptions() {
    camera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);

    final EngineOptions engineOptions =
        new EngineOptions(
            true, ScreenOrientation.LANDSCAPE_SENSOR, new FillResolutionPolicy(), this.camera);
    engineOptions.getTouchOptions().setNeedsMultiTouch(true);
    engineOptions.getAudioOptions().setNeedsSound(true);
    engineOptions.getAudioOptions().setNeedsMusic(true);

    return engineOptions;
  }
Esempio n. 6
0
 @Override
 public EngineOptions onCreateEngineOptions() {
   pAssetManager = getActivity().getAssets();
   this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
   EngineOptions engineOptions =
       new EngineOptions(
           true,
           ScreenOrientation.LANDSCAPE_FIXED,
           new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT),
           this.mCamera);
   engineOptions.getAudioOptions().setNeedsSound(true);
   return engineOptions;
 }
Esempio n. 7
0
  @Override
  public EngineOptions onCreateEngineOptions() {
    // Singleton
    instance = this;

    // Recupere instance manager ressources
    manager = ResourcesManager.getInstance();
    mCamera = new ZoomCamera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
    EngineOptions engineOptions =
        new EngineOptions(
            true, ScreenOrientation.LANDSCAPE_FIXED, new FillResolutionPolicy(), mCamera);
    engineOptions.getAudioOptions().setNeedsSound(true);
    engineOptions.getAudioOptions().setNeedsMusic(true);
    return engineOptions;
  }
Esempio n. 8
0
  // ======================================================
  // ======================================================
  @Override
  public EngineOptions onCreateEngineOptions() {
    instance = this;

    mCamera =
        new CameraManager(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT, MAX_VELOCITY, MAX_VELOCITY, 3.0f);

    mCamera.setBounds(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
    mCamera.setBoundsEnabled(true);

    EngineOptions engineOptions =
        new EngineOptions(
            true,
            ScreenOrientation.LANDSCAPE_SENSOR,
            new RatioResolutionPolicy(RES_RATIO),
            mCamera);

    engineOptions.getAudioOptions().setNeedsMusic(true);
    return engineOptions;
  }