B4A Library [B4X] [XUI] AS Confetti

Blast some confetti all over the screen and celebrate user achievements!

I spend a lot of time in creating views, like this and to create a high quality view cost a lot of time. If you want to support me and further views, then you can do it here by Paypal or with a coffee. :)


ParticleCount
Number of shapes that are generated and fall down

Gravity
The value determines how fast an object accelerates when falling.
The Default Value is 0.2

SemiTransparentShapes
The alpha value is determined randomly
1733616760078.png

SetColors
B4X:
    Dim lst_Colors As List
    lst_Colors.Initialize
    lst_Colors.Add(xui.Color_ARGB(255, 49, 208, 89))
    lst_Colors.Add(xui.Color_ARGB(255, 25, 29, 31))
    lst_Colors.Add(xui.Color_ARGB(255, 9, 131, 254))
    lst_Colors.Add(xui.Color_ARGB(255, 255, 159, 10))
    lst_Colors.Add(xui.Color_ARGB(255, 45, 136, 121))
    lst_Colors.Add(xui.Color_ARGB(255, 73, 98, 164))
    lst_Colors.Add(xui.Color_ARGB(255, 221, 95, 96))
    lst_Colors.Add(xui.Color_ARGB(255, 141, 68, 173))
    lst_Colors.Add(xui.Color_Magenta)
    lst_Colors.Add(xui.Color_Cyan)
    AS_Confetti1.SetColors(lst_Colors)
Particles
1733739076996.png


AS_Confetti
Author: Alexander Stolte
Version: 1.00
  • AS_Confetti
    • Fields:
      • mBase As B4XView
      • Tag As Object
    • Functions:
      • Base_Resize (Width As Double, Height As Double)
      • DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
        Base type must be Object
      • GenerateConfetti
      • Initialize (Callback As Object, EventName As String)
      • SetColors (ColorList As List)
        <code>
        Dim lst_Colors As List
        lst_Colors.Initialize
        lst_Colors.Add(xui.Color_ARGB(255, 49, 208, 89))
        lst_Colors.Add(xui.Color_ARGB(255, 25, 29, 31))
        lst_Colors.Add(xui.Color_ARGB(255, 9, 131, 254))
        lst_Colors.Add(xui.Color_ARGB(255, 255, 159, 10))
        lst_Colors.Add(xui.Color_ARGB(255, 45, 136, 121))
        lst_Colors.Add(xui.Color_ARGB(255, 73, 98, 164))
        lst_Colors.Add(xui.Color_ARGB(255, 221, 95, 96))
        lst_Colors.Add(xui.Color_ARGB(255, 141, 68, 173))
        lst_Colors.Add(xui.Color_Magenta)
        lst_Colors.Add(xui.Color_Cyan)
        AS_Confetti1.SetColors(lst_Colors)
        </code>
    • Properties:
      • BackgroundColor As Int
      • CircleParticle As Boolean
      • Gravity As Double
        The value determines how fast an object accelerates when falling
        Default: 0.2
      • HexagonParticle As Boolean
      • LightningParticle As Boolean
        A zigzag shape can have a dynamic effect and brings movement into play
      • ParticleCount As Int
      • RectangleParticle As Boolean
      • SemiTransparentShapes As Boolean
        The alpha value is determined randomly
      • StarParticle As Boolean
      • TriangleParticle As Boolean

Changelog
  • 1.00
    • Release
  • 1.01
    • Add new particle "HeartParticle"
      • Default: True
    • Add new particle "SnowflakeParticle"
      • Default: False
Have Fun :)
 

Attachments

  • AS Confetti Example.zip
    11 KB · Views: 23
  • AS_Confetti.b4xlib
    4 KB · Views: 14
Last edited:
Top