public class Joystick extends java.lang.Object implements ITouchListener
Constructor and Description |
---|
Joystick() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(IJoystickListener listener) |
Vector2 |
getBasePoint() |
long |
getPriority() |
boolean |
isEnabled() |
boolean |
onTouchDown(Vector2 point,
MotionEvent event)
If the user starts touching an point then initialize the joystick with
the touched position as base state
|
boolean |
onTouchMove(Vector2 point,
MotionEvent event)
Use the joystick
if its currently active
|
boolean |
onTouchUp(Vector2 point,
MotionEvent event)
The user stopped using the joystick, assuming this is the
right touch stopping (considering multi touch)
|
void |
removeListener(IJoystickListener listener) |
void |
setEnabled(boolean enabled) |
void |
setPriority(long priority) |
public long getPriority()
getPriority
in interface Prioritizable
public boolean onTouchDown(Vector2 point, MotionEvent event)
onTouchDown
in interface ITouchListener
public boolean onTouchUp(Vector2 point, MotionEvent event)
onTouchUp
in interface ITouchListener
public boolean onTouchMove(Vector2 point, MotionEvent event)
onTouchMove
in interface ITouchListener
public boolean isEnabled()
isEnabled
in interface ITouchListener
public void addListener(IJoystickListener listener)
public void removeListener(IJoystickListener listener)
public Vector2 getBasePoint()
public void setEnabled(boolean enabled)
public void setPriority(long priority)