Add mode for pointer

This commit is contained in:
Victor 2014-01-14 23:43:52 +02:00
parent ef7e708401
commit ce680c9f36

View File

@ -9,15 +9,19 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
* @author aNNiMON * @author aNNiMON
*/ */
public class Pointer { public class Pointer {
public static final int POSITIONING = 0, READY = 1;
private boolean isAccelerometerSupports, isHardwareKeyboardSupports; private boolean isAccelerometerSupports, isHardwareKeyboardSupports;
private float screenWidth, screenHeight; private float screenWidth, screenHeight;
private float x, y; private float x, y;
private int mode;
public Pointer(float width, float height) { public Pointer(float width, float height) {
x = width / 2; x = width / 2;
y = height / 2; y = height / 2;
mode = POSITIONING;
setScreenParameters(width, height); setScreenParameters(width, height);
isAccelerometerSupports = Gdx.input.isPeripheralAvailable(Peripheral.Accelerometer); isAccelerometerSupports = Gdx.input.isPeripheralAvailable(Peripheral.Accelerometer);
@ -34,6 +38,10 @@ public class Pointer {
public float getY() { public float getY() {
return y; return y;
} }
public void setMode(int mode) {
this.mode = mode;
}
public void setScreenParameters(float width, float height) { public void setScreenParameters(float width, float height) {
screenWidth = width; screenWidth = width;
@ -48,7 +56,7 @@ public class Pointer {
public void draw(ShapeRenderer renderer) { public void draw(ShapeRenderer renderer) {
control(); control();
DrawUtils.drawPointer(renderer, x, y, screenWidth, screenHeight, 1); DrawUtils.drawPointer(renderer, x, y, screenWidth, screenHeight, mode);
} }
private void control() { private void control() {