Sub Activity_Touch (Action As Int, X As Float, Y As Float)
Private dX, dY As Float
Log("Action " & Action & " X=" & x & " Y=" & Y)
Select Action ' Selects the Action parameter
Case Activity.ACTION_DOWN ' Checks if ACTION_DOWN
X0 = X ' Memorizes the X coordinate
Y0 = Y ' Memorizes the Y coordinate
X1 = lblLetter.Left ' Memorizes the Left coordinate
Y1 = lblLetter.Top ' Memorizes the Top coordinate
Case Activity.ACTION_MOVE ' Checks if ACTION_MOVE
dX = X - X0 ' Calculates the X distance moved
dY = Y - Y0 ' Calculates the X distance moved
lblLetter.Left = X1 + dX ' Sets the new Left coordinate
lblLetter.Top = Y1 + dY ' Sets the new Top coordinate
Case Activity.ACTION_UP ' Checks if ACTION_UP
Log("Left " & lblLetter.Left) ' Memorizes Left in the Map
Log("Top " & lblLetter.Top) ' Memorizes Top in the Map
lblCoord.Text = (lblLetter.Left & "-" & lblLetter.Top)
End Select
End Sub