It looks like you're new here. If you want to get involved, click one of these buttons!
How can I track the first touch on a screen. For example I have this program:
function setup()
x=0
y=0
end
function draw()
background(0,0,0)
fill(255,255,255)
ellipse(CurrentTouch.x,CurrentTouch.y)
end
However, it fails when another touch hits the screen. How can I only follow the first touch?
Comments
Try looking at the Multitouch example. You usually want to avoid CurrentTouch at all costs, because it brings up problems like this later on.
@austinmccoy Try this example. Drag the sprite around the screen while moving other fingers on the screen.
Thanks!
In your first if then loop in the touched function where you save the vector, I think you meant pos=vec2(t.x,t.y)
@austinmccoy You're correct. I corrected it in the above code.