I am drawing my score using the method :
Because the background landscape of the different levels have different colors, sometimes the drawn text is lost. Therefore, I am looking for a way to use outline fonts, but only the border of the text is drawn in the selected color and the interior of the text remains transparent, which generates the same visual awkwardness. Searching the forums I found DrawTextWithBorder and I adjusted it to my case thinking that the result would be a text with an outline, but what I got was a rectangle around the text and a blue dot in the center. I would like to know if there is a way to obtain solid color text, with another color outline. Any ideas?
B4X:
Dim gname As String = X2.GraphicCache.GetTempName
Dim ShapeSize As B2Vec2 = X2.GetShapeWidthAndHeight(template.FixtureDef.Shape)
ShapeSize.MultiplyThis(X2.mBCPixelsPerMeter)
Dim cvs As B4XCanvas = X2.GraphicCache.GetCanvas(ShapeSize.X / X2.BmpSmoothScale)
cvs.ClearRect(cvs.TargetRect)
Dim text As String = Score
Dim r As B4XRect = cvs.MeasureText(text, ScoreFont)
Dim BaseLine As Int = ShapeSize.Y / 2 - r.Height / 2 - r.Top
cvs.DrawText(text, ShapeSize.X / 2, BaseLine, ScoreFont, xui.Color_white, "CENTER")
Dim sb As X2ScaledBitmap
sb.Bmp = cvs.CreateBitmap.Crop(0, 0, ShapeSize.X, ShapeSize.Y)
sb.Scale = 1
X2.GraphicCache.PutGraphic(gname, Array(sb))
bw.GraphicName = gname
Because the background landscape of the different levels have different colors, sometimes the drawn text is lost. Therefore, I am looking for a way to use outline fonts, but only the border of the text is drawn in the selected color and the interior of the text remains transparent, which generates the same visual awkwardness. Searching the forums I found DrawTextWithBorder and I adjusted it to my case thinking that the result would be a text with an outline, but what I got was a rectangle around the text and a blue dot in the center. I would like to know if there is a way to obtain solid color text, with another color outline. Any ideas?