B4A Library [B4X] [XUI] SD CreativeBackground

Star-Dust

Expert
Licensed User
1606586088138.png
1606764752160.png


This new library is based on my latest work (here) of gradual backgrounds and @JordiCP 's code (here) that gave me permission to rework it and insert it in a custom view.

SD_CreativeBackground

Author:
Star-Dust
Version: 0.04
  • GradientBackground
    • Functions:
      • Class_Globals As String
      • GenerateGradientRounded (Width As Int, Height As Int, TintColor As Int(), Fill As String, BorderColor As Int, BorderWidth As Float, CornerRadius As Float) As B4XBitmap
        es. GenerateGradientRounded(array as int(xui.Color_Black,xui.Color_White),ColorGradient.Fill_Radial,10Dip)
        Fill = RADIAL, TR_BL , TL_BR, BL_TR , BR_TL
        TOP_BOTTOM, BOTTOM_TOP, RIGHT_LEFT, LEFT_RIGHT
      • GradientToView (Vw As B4XView, TintColor As Int(), Fill As String, BorderColor As Int, BorderWidth As Float, CornerRadius As Float) As String
        esGradientToView(MyImageView,Array As Int(0xFF9F26E7,0xFFD287DA),"radial",xui.Color_Black,0dip,20dip)
      • Initialize As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • PatternColor (PatternNumber As Int) As Int()
        PatternNumber (0..20)
  • NativeShadow
    • Functions:
      • Class_Globals As String
      • Initialize As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • NativeShadowToView (Vw As B4XView, ShadowsWidth As Float) As String
  • ShadowEffectBackground
    • Fields:
      • softness As Int ' softness shadow (set value 2 to 4)
      • TypeComics As String
      • TypeDaisy4 As String
      • TypeDaisy5 As String
      • TypeDaisy8 As String
      • TypeExagonShadow As String
      • TypeHeart As String
      • TypeRect As String
    • Functions:
      • Class_Globals As String
      • EffectBackgroundToView (Vw As B4XView, Effect As String, InvertShadow As Boolean, Color As Int, DepthEdge As Int, cornerRadius As Int, Recursive As Int, AlternateShadow As Boolean) As String
        Parameter
        GenerateBackgound(View,Effect, InvertShadow, Color, DepthEdge, CornerRadius, Recursive, AlternateShadow, Rotate) As B4XBitmap
        Vw as view,
        Effect = Type of Effect,
        InvertShadow (Light Down, Dark Up)
        Color = Color of base
        DepthEdge = Depth of shadow
        CornerRadius = 0 for rectangle
        Recursive = Shadows one inside the other (For single shadowd set=1)
        AlternateShadow = If the recursive value is greater than 1 the invert shadows alternate
      • GenerateEffectBackgound (Vw As B4XView, Effect As String, InvertShadow As Boolean, Color As Int, DepthEdge As Int, cornerRadius As Int, Recursive As Int, AlternateShadow As Boolean) As B4XBitmap
      • Initialize As String
        Initializes the object. You can add parameters to this method if needed.
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
 

Attachments

Last edited:

Peter Meares

Member
Licensed User
Hi. This looks brilliant. Could I ask to get the the "groud " changed to "ground". There are a mixture of both words and it makes searching for the article tricky. Trivial issue and I love the effects.
 

Star-Dust

Expert
Licensed User
Sorry, a typo in writing the topic title
 

Star-Dust

Expert
Licensed User
Update rel 0.03
add 5 new effects in the ShadowEffectBackground class​
  • TypeComics
  • TypeDaisy4
  • TypeDaisy5
  • TypeDaisy8
  • TypeHeart
 
Last edited:

Peter Meares

Member
Licensed User
Not really fiar as my Itaian doe snot even run to "One beer please". :)
But possibly.

EffectBackroundToView maybe EffectBackgroundToView

TypeExagonShadow maybe TypeHexagonShadow

Two instances of:
  • IsInitialized As Boolean
    Verifica se l'oggetto sia stato inizializzato.
And this
DeptEdge = Dept of shadow
is probably
DepthEdge = Depth of shadow

Sorry. They are amazing and I couldn't think how to create them.
Thx
 

Star-Dust

Expert
Licensed User
You obviously didn't do a good job last time and you didn't report all the errors
  • IsInitialized As Boolean
    Verifica se l'oggetto sia stato inizializzato
To create the documentation I use a Java tool created by @Informatix (here). The message is produced in Italian because my IDE is in Italian. I have no intention of changing the settings of the IDE

B4X:
Sorry. They are amazing and I couldn't think how to create them.
Thx
On the other hand, you know English. Be satisfied
 
Last edited:
Top