یه سوال در مورد این سورسم داشتم اینکه هر کاری میکنم لیبل ساخته شده فقط از ابتدای عرض خودش چرخش می کنه در حالی که من میخوام از مرکزش بچرخه
میشه راهنمایی کنید
#Region Project Attributes
#ApplicationLabel: ViewRotation
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
Dim Timer1 As Timer
End Sub
Sub Globals
Dim lblTest1 As Label
Dim Alpha = 0 As Float
End Sub
Sub Activity_Create(FirstTime As Boolean)
Timer1.Initialize("Timer1", 10)
Activity.LoadLayout("main")
setPivotX(lblTest1, 0)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Activity_Click
Timer1.Enabled = Not(Timer1.Enabled)
End Sub
Sub Timer1_Tick
Alpha = Alpha + 10
If Alpha >= 360 Then
Timer1.Enabled = False
Alpha = 0
End If
setRotationY(lblTest1.Width/2, Alpha)
End Sub
'Sets the rotation angle around the Y axis of the given view
'v = view
'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
'Sets the rotation angle of the given view
'v = view
'Angle = rotation angle in degrees
Sub setRotation(v As View, Angle As Float)
Dim jo = v As JavaObject
jo.RunMethod("setRotation", Array As Object(Angle))
End Sub
'Sets the X pivot point of the given view
'v = view
'X = X coordinate of the pivot in pixels
'reference upper left corner, default pivot middle of the view
Sub setPivotX(v As View, X As Float)
Dim jo = v As JavaObject
jo.RunMethod("setPivotX", Array As Object(X))
End Sub
'Sets the Y pivot point of the given view
'v = view
'Y = Y coordinate of the pivot in pixels
'reference upper left corner, default pivot middle of the view
Sub setPivotY(v As View, Y As Float)
Dim jo = v As JavaObject
jo.RunMethod("setPivotY", Array As Object(Y))
End Sub
'Gets the X pivot point of the given view
Sub getPivotX(v As View) As Float
Dim jo = v As JavaObject
Return jo.RunMethod("getPivotX", Null)
End Sub
'Gets the Y pivot point of the given view
Sub getPivotY(v As View) As Float
Dim jo = v As JavaObject
Return jo.RunMethod("getPivotY", Null)
End Sub
سوال
mverkiani 12
یه سوال در مورد این سورسم داشتم اینکه هر کاری میکنم لیبل ساخته شده فقط از ابتدای عرض خودش چرخش می کنه در حالی که من میخوام از مرکزش بچرخه
میشه راهنمایی کنید
#Region Project Attributes #ApplicationLabel: ViewRotation #VersionCode: 1 #VersionName: 'SupportedOrientations possible values: unspecified, landscape or portrait. #SupportedOrientations: unspecified #CanInstallToExternalStorage: False #End Region #Region Activity Attributes #FullScreen: False #IncludeTitle: True #End Region Sub Process_Globals Dim Timer1 As Timer End Sub Sub Globals Dim lblTest1 As Label Dim Alpha = 0 As Float End Sub Sub Activity_Create(FirstTime As Boolean) Timer1.Initialize("Timer1", 10) Activity.LoadLayout("main") setPivotX(lblTest1, 0) End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub Activity_Click Timer1.Enabled = Not(Timer1.Enabled) End Sub Sub Timer1_Tick Alpha = Alpha + 10 If Alpha >= 360 Then Timer1.Enabled = False Alpha = 0 End If setRotationY(lblTest1.Width/2, Alpha) End Sub 'Sets the rotation angle around the Y axis of the given view 'v = view '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 'Sets the rotation angle of the given view 'v = view 'Angle = rotation angle in degrees Sub setRotation(v As View, Angle As Float) Dim jo = v As JavaObject jo.RunMethod("setRotation", Array As Object(Angle)) End Sub 'Sets the X pivot point of the given view 'v = view 'X = X coordinate of the pivot in pixels 'reference upper left corner, default pivot middle of the view Sub setPivotX(v As View, X As Float) Dim jo = v As JavaObject jo.RunMethod("setPivotX", Array As Object(X)) End Sub 'Sets the Y pivot point of the given view 'v = view 'Y = Y coordinate of the pivot in pixels 'reference upper left corner, default pivot middle of the view Sub setPivotY(v As View, Y As Float) Dim jo = v As JavaObject jo.RunMethod("setPivotY", Array As Object(Y)) End Sub 'Gets the X pivot point of the given view Sub getPivotX(v As View) As Float Dim jo = v As JavaObject Return jo.RunMethod("getPivotX", Null) End Sub 'Gets the Y pivot point of the given view Sub getPivotY(v As View) As Float Dim jo = v As JavaObject Return jo.RunMethod("getPivotY", Null) End Subلینک ارسال
به اشتراک گذاری در سایت های دیگر
6 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.