B4A Class SD: MeteorView

I created a new class that animates the background of any view and makes a starry sky appear with falling meteors.

I also attach the source code

B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Private PanelMain As Panel
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("Layout1")
    Dim M As meteorView
 
    M.Initialize(PanelMain)
End Sub
video1.gif
 

Attachments

  • MeteorView Class.zip
    10 KB · Views: 309
  • MeteorView Class 2.zip
    10.1 KB · Views: 300
Last edited:

Mahares

Expert
Licensed User
Longtime User
animates the background of any view
Did you try to apply the class to a label or a button. It seems to hang, constantly showing 'Waiting for IDE debugger to connect' and nothing happens
B4X:
Private lbl As Label
B4X:
Dim M As meteorView   
M.Initialize(lbl)
 

Star-Dust

Expert
Licensed User
Longtime User
Did you try to apply the class to a label or a button. It seems to hang, constantly showing 'Waiting for IDE debugger to connect' and nothing happens
B4X:
Private lbl As Label
B4X:
Dim M As meteorView  
M.Initialize(lbl)
The code tries to create the stars of random points with a minimum distance of 40dips. If the Label is too small it goes to a standstill.

I have updated the code so that it has an exit from the stall. However, the distance between the stars can also be reduced and the same would be solved

this is the result:
1.png
 
Top