iOSCanvas.PointerDown

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Event


iOSCanvas.PointerDown(pos As Point, eventInfo As iOSEventInfo)

Supported on Mobile (iOS).

Called when the pointing device is tapped, touched or clicked.

Sample Code

This code saves all touch points to an array, which is used to display circles in the Paint event:

// mTouches is a property
// mTouches() As Point

If eventInfo.PointerCount > 0 Then
// Save multi-touch points
For i As Integer = 0 To eventInfo.PointerCount - 1
mTouches.Append(eventInfo.PointerPosition(i))
Next
Else
mTouches.Append(pos)
End If

Me.Invalidate

This code goes in the Paint event handler:

For Each p As Point In mTouches
g.FillColor = Color.Blue
g.FillOval(p.X, p.Y, 10, 10)
Next