Add pointer class
This commit is contained in:
parent
4f7a65a3bd
commit
8e10f4d1de
28
src/com/annimon/influencexxii/Pointer.java
Normal file
28
src/com/annimon/influencexxii/Pointer.java
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package com.annimon.influencexxii;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Controlling pointer by user
|
||||||
|
* @author aNNiMON
|
||||||
|
*/
|
||||||
|
public class Pointer {
|
||||||
|
|
||||||
|
private int screenWidth, screenHeight;
|
||||||
|
private int x, y;
|
||||||
|
|
||||||
|
public Pointer(int width, int height) {
|
||||||
|
x = width / 2;
|
||||||
|
y = height / 2;
|
||||||
|
setScreenParameters(width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScreenParameters(int width, int height) {
|
||||||
|
screenWidth = width;
|
||||||
|
screenHeight = height;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void draw(ShapeRenderer renderer) {
|
||||||
|
DrawUtils.drawPointer(renderer, x, y, screenWidth, screenHeight, 1);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user