Monkey: multitouch demo

Strict
Import mojo

Function Main:Int()
    New MyApp
    Return 0
End

Class MyApp Extends App
    Method OnCreate:Int()
        SetUpdateRate(120)
        Return 0
    End

    Method OnUpdate:Int()
        Return 0
    End

    Method OnRender:Int()
        Cls(0,0,0)
        Local dy:Int = 30
        For Local i:Int = 0 To 31
            If TouchDown(i) Then
                If i Mod 2 = 0 Then
                    SetColor(255,0,0)
                Else
                    SetColor(0,0,255)
                End
                DrawCircle(TouchX(i),TouchY(i),50)
                SetColor(255,255,255)
                DrawText(""+i, 10, dy)
                DrawText(""+Int(TouchX(i)), 40, dy)
                DrawText(""+Int(TouchY(i)), 80, dy)
                dy+=20
            End
        End
        DrawText("idx",10,10)
        DrawText("x",40,10)
        DrawText("y",80,10)
        Return 0
    End
End