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;
  }
 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;
 }
Beispiel #3
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;
 }
Beispiel #4
0
 @Override
 public EngineOptions onCreateEngineOptions() {
   mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
   EngineOptions options =
       new EngineOptions(
           true,
           ScreenOrientation.LANDSCAPE_FIXED,
           new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT),
           mCamera);
   options.getTouchOptions().setNeedsMultiTouch(true);
   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;
 }
  // -----------------------------------------------------------------------//
  // 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;
  }
 @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;
 }
  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;
    }
  }
Beispiel #9
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;
  }
  @Override
  public EngineOptions onCreateEngineOptions() {

    Display d = getWindowManager().getDefaultDisplay();
    Point size = new Point();
    d.getSize(size);
    WIDTH = size.x;
    HEIGHT = size.y;
    camera = new Camera(0, 0, WIDTH, HEIGHT);

    EngineOptions e =
        new EngineOptions(
            true, ScreenOrientation.LANDSCAPE_FIXED, new FillResolutionPolicy(), camera);
    e.getTouchOptions().setNeedsMultiTouch(true);
    e.getRenderOptions().setDithering(true);

    return e;
  }
Beispiel #11
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;
  }
Beispiel #12
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;
  }
  @Override
  public EngineOptions onCreateEngineOptions() {
    this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);

    final EngineOptions engineOptions =
        new EngineOptions(
            true,
            ScreenOrientation.LANDSCAPE_SENSOR,
            new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT),
            this.mCamera);
    engineOptions.getTouchOptions().setNeedsMultiTouch(true);

    if (MultiTouch.isSupported(this)) {
      if (MultiTouch.isSupportedDistinct(this)) {
        Toast.makeText(
                this,
                "MultiTouch detected --> Both controls will work properly!",
                Toast.LENGTH_SHORT)
            .show();
      } else {
        this.mPlaceOnScreenControlsAtDifferentVerticalLocations = true;
        Toast.makeText(
                this,
                "MultiTouch detected, but your device has problems distinguishing between fingers.\n\nControls are placed at different vertical locations.",
                Toast.LENGTH_LONG)
            .show();
      }
    } else {
      Toast.makeText(
              this,
              "Sorry your device does NOT support MultiTouch!\n\n(Falling back to SingleTouch.)\n\nControls are placed at different vertical locations.",
              Toast.LENGTH_LONG)
          .show();
    }

    return engineOptions;
  }