Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Dim Button1 As Button
Dim Button1Timer As Timer
Dim Button1X As Int
Dim Button1Y As Int
Dim Button1SizeX As Int
Dim Button1SizeY As Int
Dim Button1ThrobX As Int
Dim Button1ThrobY As Int
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
Sleep(0) 'give Button1 chance to initialize
Button1SizeX = Button1.Width
Button1SizeY = Button1.Height
Button1X = Button1.Left
Button1Y = Button1.Top
Button1ThrobX = Min(Button1SizeX, Button1SizeY) * 0.05 'relative throb size 5%
Button1ThrobY = Button1ThrobX 'same throb for both axes
Button1Timer.Initialize("Button1", 1000 / 15) '15 frames per second
Button1Timer.Enabled = True
End Sub