I am learning how to make android apps, and I can't figure out how to implement a kind of OnMouseMoved event in android.
I've tried using an OnTouchListener, but It doesn't update when I touch, hold and move. It only updates when I tap a different points. Like this:
public boolean onTouch(View v, MotionEvent event) {
int x = (int) event.getX();
thread.getGameState().touch(x);
return false;
}
I've tried this
@Override
public boolean onTouch(View v, MotionEvent event) {
int x = (int) event.getX();
if(event.getAction() == MotionEvent.ACTION_MOVE) {
thread.getGameState().touch(x);
}
return false;
}
But this doesn't even respond at all to touch, maybe the point i'm getting from the event is an old point, and not the new drag point?
thread.getGameState().touch(x);
sets the x-value of and object, which should make it like dragging.