Hi to everybody,
I'm trying to create a jupiter moons movement calculator, but when I try to draw and delete the drawing on the panel, everything stays there. Can anyone see my error?
Thanks in advance
I'm trying to create a jupiter moons movement calculator, but when I try to draw and delete the drawing on the panel, everything stays there. Can anyone see my error?
Thanks in advance
B4X:
Sub dibujaposicion
Dim sa As List
sa.Initialize
sa.AddAll(posicionlunas)
canvas2.DrawCircle(50%x, 50%y, 20dip, Colors.Red, True, 10dip)
canvas2.DrawCircle((sa.get(0)*2%x)+50%x,(sa.get(1)*2%y)+50%y, 5dip, Colors.blue, True, 10dip)
canvas2.DrawCircle((sa.get(2)*2%x)+50%x,(sa.get(3)*2%y)+50%y, 5dip, Colors.green, True, 10dip)
canvas2.DrawCircle((sa.get(4)*2%x)+50%x,(sa.get(5)*2%y)+50%y, 5dip, Colors.magenta, True, 10dip)
canvas2.DrawCircle((sa.get(6)*2%x)+50%x,(sa.get(7)*2%y)+50%y, 5dip, Colors.white, True, 10dip)
End Sub
Sub Button3_Click
'Dim sa As List
'sa.Initialize
'sa.AddAll(posicionlunas)
'Dim canvas1 As Canvas
panel1.visible=False
panel2.Visible=True
canvas2.Initialize(panelmoon)
dibujaposicion
'canvas1.DrawCircle(50%x, 50%y, 20dip, Colors.Red, True, 10dip)
'canvas1.DrawCircle((sa.get(0)*2%x)+50%x,(sa.get(1)*2%y)+50%y, 5dip, Colors.blue, True, 10dip)
'canvas1.DrawCircle((sa.get(2)*2%x)+50%x,(sa.get(3)*2%y)+50%y, 5dip, Colors.green, True, 10dip)
'canvas1.DrawCircle((sa.get(4)*2%x)+50%x,(sa.get(5)*2%y)+50%y, 5dip, Colors.magenta, True, 10dip)
'canvas1.DrawCircle((sa.get(6)*2%x)+50%x,(sa.get(7)*2%y)+50%y, 5dip, Colors.white, True, 10dip)
End Sub
Sub adelantel_Click
panelmoon.invalidate
JDN=JDN+0.1
dibujaposicion
End Sub
Sub atrasl_Click
panelmoon.Invalidate
JDN=JDN-0.1
dibujaposicion
End Sub