#Region Project Attributes
#ApplicationLabel: b4aMorphos
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
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 panelmorph As Morphos
Dim p1 As Panel
Private iv1 As ImageView
Private l1 As Label
Dim cnt As Int = 0
Dim xpos, ypos As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main")
panelmorph.Initialize("pnl")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub p1_click
If cnt = 0 Then
xpos = p1.Left
ypos = p1.Top
panelmorph.Translation(p1, 200, 100, 0, 1500)
End If
End Sub
Sub pnl_animation_started()
End Sub
Sub pnl_animation_stopped()
cnt = cnt + 1
Log("cnt = " & cnt)
If cnt = 1 Then
panelmorph.Translation(p1, xpos, ypos, 0, 1500)
End If
If cnt = 2 Then
panelmorph.Alpha(p1, 0, 1500)
End If
If cnt = 3 Then
panelmorph.Alpha(p1, 100, 1500)
End If
If cnt = 4 Then
panelmorph.RotationXY(p1, 45, 45, 1500)
End If
If cnt = 5 Then
panelmorph.RotationXY(p1, 0, 0, 1500)
End If
If cnt = 6 Then
panelmorph.RotationXY(p1, -45, -45, 1500)
End If
If cnt = 7 Then
panelmorph.RotationXY(p1, 0, 0, 1500)
End If
If cnt = 8 Then
panelmorph.TranslationY(p1, 300, 1500)
End If
If cnt = 9 Then
panelmorph.Rotation(p1, 720, 1500)
End If
If cnt = 10 Then
panelmorph.Rotation(p1, -720, 1500)
End If
If cnt = 11 Then
panelmorph.TranslationY(p1, ypos, 1500)
End If
If cnt = 12 Then
panelmorph.TranslationX(p1, Activity.Width - p1.width, 1500)
End If
If cnt = 13 Then
panelmorph.TranslationY(p1, Activity.Height - p1.Height, 1500)
End If
If cnt = 14 Then
panelmorph.TranslationX(p1, 0, 1500)
End If
If cnt = 15 Then
panelmorph.TranslationY(p1, 0, 1500)
End If
If cnt = 16 Then
panelmorph.Translation(p1, xpos, ypos, 0, 1500)
End If
If cnt = 17 Then
panelmorph.RotationXY(iv1, 45, 45, 1500)
End If
If cnt = 18 Then
panelmorph.RotationXY(iv1, 0, 0, 1500)
End If
If cnt = 19 Then
panelmorph.RotationXY(iv1, -45, -45, 1500)
End If
If cnt = 20 Then
panelmorph.RotationXY(iv1, 0, 0, 1500)
End If
If cnt = 21 Then
cnt = 0
End If
End Sub