Android Open Source - iSlide Input Handler






From Project

Back to project page iSlide.

License

The source code is released under:

MIT License

If you think the Android project iSlide listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package edu.csun.group2.islide.engine;
// ww  w  . j ava  2s .c o  m
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.math.Rectangle;

import edu.csun.group2.islide.global.GameInfo;

public class InputHandler implements InputProcessor {

  @Override
  public boolean keyDown(int keycode) {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public boolean keyUp(int keycode) {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public boolean keyTyped(char character) {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public boolean touchDown(int screenX, int screenY, int pointer, int button) {
    GameInfo.getInstance().touching = true;
    if (GameInfo.getInstance().touchRectangle == null) {
      GameInfo.getInstance().touchRectangle = new Rectangle(screenX,
          screenY, 1, 1);
    }
    else{
      GameInfo.getInstance().touchRectangle.x = screenX;
      GameInfo.getInstance().touchRectangle.y = screenY;
    }
    GameInfo.getInstance().justTouched = true;
    return false;
  }

  @Override
  public boolean touchUp(int screenX, int screenY, int pointer, int button) {
    GameInfo.getInstance().touching = false;
    GameInfo.getInstance().justTouched = false;
    return false;
  }

  @Override
  public boolean touchDragged(int screenX, int screenY, int pointer) {
    GameInfo.getInstance().touching = true;
    if (GameInfo.getInstance().touchRectangle != null) {
      GameInfo.getInstance().touchRectangle.x = screenX;
      GameInfo.getInstance().touchRectangle.y = screenY;
    } else {
      GameInfo.getInstance().touchRectangle = new Rectangle(screenX,
           screenY, 1, 1);
    }
    GameInfo.getInstance().justTouched = true;
    return false;
  }

  @Override
  public boolean mouseMoved(int screenX, int screenY) {
    // TODO Auto-generated method stub
    return false;
  }

  @Override
  public boolean scrolled(int amount) {
    // TODO Auto-generated method stub
    return false;
  }

}




Java Source Code List

edu.csun.group2.islide.CameraPreview.java
edu.csun.group2.islide.HighScore.java
edu.csun.group2.islide.MainActivity.java
edu.csun.group2.islide.MainMenuActivity.java
edu.csun.group2.islide.PhotoHandler.java
edu.csun.group2.islide.PlayMenu.java
edu.csun.group2.islide.SelectImageActivity.java
edu.csun.group2.islide.SettingsMenu.java
edu.csun.group2.islide.TakePictureActivity.java
edu.csun.group2.islide.UtilityInfo.java
edu.csun.group2.islide.Utility.java
edu.csun.group2.islide.engine.BoardTest.java
edu.csun.group2.islide.engine.Board.java
edu.csun.group2.islide.engine.GameBoardTest.java
edu.csun.group2.islide.engine.GameBoard.java
edu.csun.group2.islide.engine.GameManager.java
edu.csun.group2.islide.engine.InputHandler.java
edu.csun.group2.islide.engine.MoveComparator.java
edu.csun.group2.islide.engine.MoveTest.java
edu.csun.group2.islide.engine.Move.java
edu.csun.group2.islide.engine.Pair.java
edu.csun.group2.islide.engine.entity.SlideTile.java
edu.csun.group2.islide.engine.entity.TileManager.java
edu.csun.group2.islide.global.GameInfo.java
edu.csun.group2.islide.interfaces.IRenderable.java
edu.csun.group2.islide.iSlide.java