'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim bgd2 As Panel
Dim GG As Gestures
Dim TouchMap2 As Map
Type Point2(Id As Int, Zone As Int, X As Int, Y As Int, origX As Int, origY As Int, prevX As Int, prevY As Int, distFromPrev As Int, stepsComplete As Int, Color As Int)
Dim Canvas2 As Canvas
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Create a panel and add it to the activity
bgd2.Initialize("")
Activity.AddView(bgd2, 0, 0, 100%x, 100%y)
Canvas2.Initialize(bgd2)
'Add a listener for this panel
GG.SetOnTouchListener(bgd2, "GesturesTouch2")
TouchMap2.Initialize
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub GesturesTouch2(View As Object, PointerID As Int, Action As Int, X As Float, Y As Float) As Boolean
Dim p As Point2
Select Action
Case GG.ACTION_DOWN, GG.ACTION_POINTER_DOWN
'New Point is assigned to the new touch
p.Id = PointerID
p.Color = Colors.RGB(Rnd(0, 255), Rnd(0, 255), Rnd(0, 255))
TouchMap2.Put(PointerID, p)
p.origX = GG.GetX(PointerID)
p.origY = GG.GetY(PointerID)
Log (p.origX)
Log("Action/Pointer Down")
Log("TouchMap2.Size = " & TouchMap2.Size)
Case GG.ACTION_POINTER_UP
TouchMap2.Remove(PointerID)
Log("ACTION_POINTER_UP Called")
Case GG.ACTION_MOVE
Log("ACTION_MOVE Called")
Case GG.ACTION_UP
'This is the end of this gesture
Log("ACTION_UP Called")
TouchMap2.Clear
End Select
For i = 0 To TouchMap2.Size - 1
Dim p As Point2
p = TouchMap2.GetValueAt(i)
Log("--------------")
Log("Point " & i & " X: " & GG.GetX(p.id))
Log("Point " & i & " Y: " & GG.GetY(p.id))
Next
DoSomething
End Sub
Sub DoSomething
Dim a As Int
a = 1
End Sub