DockActivity.java :  » Game » tk-gloomroomtd » com » telekawaru » gloomroomtd » Android Open Source

Android Open Source » Game » tk gloomroomtd 
tk gloomroomtd » com » telekawaru » gloomroomtd » DockActivity.java
package com.telekawaru.gloomroomtd;

import android.content.Intent;
import com.stickycoding.rokon.DrawPriority;
import com.stickycoding.rokon.RokonActivity;
import com.stickycoding.rokon.Scene;
import com.telekawaru.gloomroomtd.scene.DockScene;

public class DockActivity extends RokonActivity {
  public static final float GAME_WIDTH = 854f;
  public static final float GAME_HEIGHT = 480f;
  
  public Intent callingIntent;
  public Integer iDockMode;
  
  public static DockActivity dAct;
  
  public void changeScene(Scene scene) {
    this.setScene(scene);
  }
  
  @Override
  public void onCreate() {
    debugMode();
    callingIntent = super.getIntent();
    iDockMode = callingIntent.getIntExtra("EXTRA_DOCK_STATE", 9);
    this.forceFullscreen();
    this.forceLandscape();
    this.setGameSize(GAME_WIDTH, GAME_HEIGHT);
    this.forceGameSize(GAME_WIDTH, GAME_HEIGHT);
    setDrawPriority(DrawPriority.PRIORITY_VBO);
    this.setGraphicsPath("textures/");
    dAct = this;
    //this.disableBack();
    this.createEngine();
  }

  @Override
  public void onDestroy() {
    System.exit(0);
  }
/*  
  @Override
  public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (this.isFinishing()) return super.onKeyDown(keyCode, event);
    if ((keyCode == KeyEvent.KEYCODE_VOLUME_UP) || (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN))
      getScene().onKeyDown(keyCode);
    else
      return super.onKeyDown(keyCode, event);
  }
  @Override
  public boolean onKeyUp(int keyCode, KeyEvent event) {
    if (this.isFinishing()) return super.onKeyDown(keyCode, event);
    if ((keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) || (keyCode == KeyEvent.KEYCODE_VOLUME_UP))
      return getScene().onKeyUp(keyCode);
    else
      return super.onKeyUp(keyCode, event);
  }
*/

  @Override
  public void onLoadComplete() {
    if (!this.isFinishing()) this.changeScene(new DockScene());
  }

  @Override
  public void onResume() {
    super.onResume();
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.