Code example for MotionEvent.PointerCoords

0
		this.x = x;
		this.y = y;
	} 
	 
	public static Vector2 FromMotionEvent(MotionEvent event, int pointer) {
		PointerCoords pc = new PointerCoords();
		event.getPointerCoords(pointer, pc);
		 
		return new Vector2(pc.x, pc.y);
	} 
	 
	public float x, y;
} 
Connect your IDE to all the code out there  Get Codota for Java