I have this code from the forum to rotate the panel on its Y axis:
The rotation takes almost 6 seconds to rotate. Without the Sleep(0), you don't see any animation (rotation) of the Panel (pnl), which is desired.
I've tried the Animation library, but it does not rotate the Panel on its Y axis.
Also, the pnl.SetRotationAnimated(1000,360) doesn't rotate on the Y axis.
The rotation duration desired would be 500 to 1000 milliseconds.
Any suggestions would be appreciated.
Mark Stuart
B4X:
Sub Class_Globals
Dim pnl As B4XView 'pnl is on a Layout
End Sub
Sub btnRotate_Click
For i = 0 To 360
setRotationY(pnl,i)
Sleep(0)
Next
End Sub
'Angle = rotation angle in degrees
Sub setRotationY(v As View, Angle As Float)
Dim jo = v As JavaObject
jo.RunMethod("setRotationY", Array As Object(Angle))
End Sub
The rotation takes almost 6 seconds to rotate. Without the Sleep(0), you don't see any animation (rotation) of the Panel (pnl), which is desired.
I've tried the Animation library, but it does not rotate the Panel on its Y axis.
Also, the pnl.SetRotationAnimated(1000,360) doesn't rotate on the Y axis.
The rotation duration desired would be 500 to 1000 milliseconds.
Any suggestions would be appreciated.
Mark Stuart
Last edited: