Android Question How to adding Shadow Text on BBCodeView?

subkiie

New Member
B4X:
            Dim pref As String = "A,B,C,"
            Dim suff As String = "F,G"
   
            TextEngine.Initialize(Root)
            BBCodeView1.TextEngine = TextEngine
           
            Dim MyFont As Typeface
            MyFont = Typeface.LoadFromAssets("gomarice_gogono_cocoa_mochi.ttf")
           
            Dim edt As EditText
            edt.Initialize("edt")
            edt.SetLayoutAnimated(0, 0, 0, 90dip, 80dip)
            edt.TextColor = Colors.White
            edt.TextSize = 80
            edt.Padding = Array As Int(0dip,0dip,0dip,0dip)
            edt.Typeface = MyFont
            edt.ForceDoneButton =True
            edt.Wrap = True
            edt.SingleLine = True
            edt.RequestFocus
            BBCodeView1.Views.Put("edt",edt)
            BBCodeView1.Text = $"[TextSize=80]${pref}[/TextSize] [View=edt Vertical=10/] [TextSize=80]${suff}[/TextSize]"$
            BBCodeView1.mBase.Top = 45%y

For code above, i can using text and EditText in BBCodeView1, but i can't adding Shadow on text.

Screenshot_3.png is Label with shadowed.
Screenshot_2.png is BBCodeView, i can't adding shadow on this text.

Please help.
Thank you
 

Attachments

  • Screenshot_3.png
    Screenshot_3.png
    490.1 KB · Views: 178
  • Screenshot_2.png
    Screenshot_2.png
    483.7 KB · Views: 179
Last edited:

subkiie

New Member
Nice!

Example of adding a shadow using a slightly shifted B4XImageView + snapshot + BitmapCreatorEffects.GrayScale.

View attachment 129996
Try the B4A project.
Hi Erel, thank you for solution..
it's work for me if the text color is not white.
but when i change it to white, you can't see the shadow
 

Attachments

  • Screenshot_4.png
    Screenshot_4.png
    483 KB · Views: 147
Upvote 0
Top