private int mActivePointerId;
public boolean onTouchEvent(MotionEvent event) {
....
// Get the pointer ID
mActivePointerId = event.getPointerId(0);
// ... Many touch events later...
// Use the pointer ID to find the index of the active pointer
// and fetch its position
int pointerIndex = event.findPointerIndex(mActivePointerId);
// Get the pointer's current position
float x = event.getX(pointerIndex);
float y = event.getY(pointerIndex);
}
var startState = {
fill:"red",
stroke: "#000",
strokeWidth:1
};
var s = Snap("#svg");
var ball = s.circle(150, 150, 15);
ball.attr(startState);
var twoBall= s.circle(150, 150, 15);
twoBall.node.onmouseover = function(){
twoBall.animate({ transform:'translate(10,-30,5)'}, 50);
};
twoBall.node.onmouseout = function(){
twoBall.animate(startState, 50);
};
twoBall.node.onclick = function(){
twoBall.attr({ fill:"green"});
}