#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#End Region
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private cnv As B4XCanvas
Private xui As XUI
Private vpW, vpH As Float
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
vpW = MainForm.RootPane.Width
vpH = MainForm.RootPane.Height
cnv.Initialize(MainForm.RootPane)
cnv.DrawRect(cnv.TargetRect,xui.Color_Black,True,0)
drawgloweffect
End Sub
Sub drawgloweffect
cnv.DrawCircle(vpW/2,vpH/2,vpW*0.3,xui.Color_Cyan,False,vpW*0.02)
Dim lines As Int = 10
Dim alphastep As Int = 100/lines
For i = 1 To lines
Dim newcolor() As Int = GetARGB(xui.Color_Cyan,Max(0,100-(i*alphastep)))
cnv.DrawCircle(vpW/2,vpH/2,(vpW*0.3)+(vpW*(i/300)),xui.Color_ARGB(newcolor(0),newcolor(1),newcolor(2),newcolor(3)),False,vpW*0.0055)
cnv.DrawCircle(vpW/2,vpH/2,(vpW*0.3)-(vpW*(i/300)),xui.Color_ARGB(newcolor(0),newcolor(1),newcolor(2),newcolor(3)),False,vpW*0.0055)
Next
End Sub
Sub GetARGB(Color As Int, alphaint As Int) As Int()
Private res(4) As Int
res(0) = alphaint 'Bit.UnsignedShiftRight(Bit.And(Color, 0xff000000), 24)
res(1) = Bit.UnsignedShiftRight(Bit.And(Color, 0xff0000), 16)
res(2) = Bit.UnsignedShiftRight(Bit.And(Color, 0xff00), 8)
res(3) = Bit.And(Color, 0xff)
Return res
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub