Label1.Width = -2 'Can be done in Designer also ..
Label1.Text = "12345"
Label1.SetColorAndBorder(xui.Color_White, 2dip, xui.Color_Black, 0)
Yes you are rightI think he mean
View attachment 156865
having the text with a coloured border around every character.
You should post your error messages as text ...there are Errors
DrawTextWithOutline("Hello, World!", 100, 100, xui.Color_White, xui.Color_Black, 48)
Sub DrawTextWithOutline(text As String, x As Float, y As Float, textColor As Int, outlineColor As Int, textSize As Float)
Dim xFont As B4XFont = xui.CreateDefaultFont(textSize)
xCanvas.DrawText(text, x - 1, y, xFont, outlineColor, "LEFT")
xCanvas.DrawText(text, x + 1, y, xFont, outlineColor, "LEFT")
xCanvas.DrawText(text, x, y - 1, xFont, outlineColor, "LEFT")
xCanvas.DrawText(text, x, y + 1, xFont, outlineColor, "LEFT")
xCanvas.DrawText(text, x, y, xFont, textColor, "LEFT")
xCanvas.Invalidate
End Sub
DrawTextWithOutline("Hello, World!", 100, 100, 3, 0xB5FFFFFF, xui.Color_Yellow, 48)
Sub DrawTextWithOutline(text As String, x As Float, y As Float, Thickness As Int, textColor As Int, outlineColor As Int, textSize As Float)
Dim xFont As B4XFont = xui.CreateDefaultFont(textSize)
xCanvas.DrawText(text, x - Thickness, y, xFont, outlineColor, "LEFT")
xCanvas.DrawText(text, x + Thickness, y, xFont, outlineColor, "LEFT")
xCanvas.DrawText(text, x, y - Thickness, xFont, outlineColor, "LEFT")
xCanvas.DrawText(text, x, y + Thickness, xFont, outlineColor, "LEFT")
xCanvas.DrawText(text, x, y, xFont, textColor, "LEFT")
xCanvas.Invalidate
End Sub
Unknown type: b4xmainpage
Are you missing a library reference?
seeThank you @TILogistic
im getting this eror
What is the wrong?B4X:Unknown type: b4xmainpage Are you missing a library reference?