You must add an Activity.Invalidate statement after the DrawCircle statement to force the OS to update the Activity.
Sub TIMER1_tick
If x < 300 Then
x = x + 2dip
LAYER.DrawCircle( x, y, 20, Colors.red, True, 1dip )
Activity.Invalidate
End If
End Sub
I changed your routine a bit:
- LAYER.DrawCircle( x, y, 20, Colors.red, True, 1dip )
-- 1dip instead of 10dip as you fill it.
-- insides the If statement, no need to draw the circle at the same position, you could even stop the Timer if x>300 with Else.
To make the Activity update faster you could define the surrounding rectangle of the circle and use Invalidate2(rect).
If you would erase the previous circle you need to memorize the current coordinates or better the current surrounding rectangle and draw a transparent rectangle or circle before drawing the new circle.
You could have a look at chapter 14 Graphics in the
Beginner's Guide, there are some explained examples in.
Best regards.