From 0ec3bb6dbac8daf0ca5c065024960b237070976b Mon Sep 17 00:00:00 2001 From: "kim..ng" Date: Sun, 15 May 2011 19:14:53 +0000 Subject: [PATCH] src/android patchset: changes AndroidAssetManager, AndroidInput, OGLESContext, JmeSystem, TextureLoader git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7501 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/input/android/TouchEvent.java | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 engine/src/android/com/jme3/input/android/TouchEvent.java diff --git a/engine/src/android/com/jme3/input/android/TouchEvent.java b/engine/src/android/com/jme3/input/android/TouchEvent.java new file mode 100644 index 000000000..e7c31fe5c --- /dev/null +++ b/engine/src/android/com/jme3/input/android/TouchEvent.java @@ -0,0 +1,76 @@ +package com.jme3.input.android; + +import com.jme3.math.Vector2f; + +public class TouchEvent +{ + public static enum Type {GRABBED,DRAGGED,RELEASED,FLING,TAP,DOUBLETAP,LONGPRESSED,SCALE,OUTSIDE,IDLE} + public Type type=Type.IDLE; + + public static enum Operation {NOP,STARTED,RUNNING,STOPPED,CANCELED} + private Operation operation=Operation.NOP; + + public float x; + public float y; + public float deltax; + public float deltay; + public float[] extra; + + public TouchEvent(Type type, Operation operation, float x, float y, float deltax, float deltay, float[] extra) + { + set(type, operation, x, y, deltax, deltay, extra); + } + + public void set( Type type, Operation operation, float x, float y, float deltax, float deltay, float[] extra) + { + this.type=type; + this.operation=operation; + this.x=x; + this.y=y; + this.deltax=deltax; + this.deltay=deltay; + this.extra=extra; + } + + + public Type getType() + { + return type; + } + + public Operation getOperation() + { + return operation; + } + + + public float getX() + { + return x; + } + + public float getY() + { + return y; + } + + public float getDeltaX() + { + return deltax; + } + + public float getDeltaY() + { + return deltay; + } + + public float[] getExtra() + { + return extra; + } + + public Vector2f getDelta() + { + return new Vector2f(deltax,deltay); + } +}