Hi,
Almost done with the Godot game shell.
We have an issue with outlined text.
Sometimes the left part of outlined text is cut off?
Please see below screenshot and script source code.
Any help would be appreciated, thanks!
Game project is on GitHub below:
https://github.com/FallenAngelSoftware/Godot-SpaceSwap2
Jesse
www.FallenAngelSoftware.com

SOURCE CODE IS BELOW:
func DrawText(var index, var text, var x, var y, var horizontalJustification, var fontSize, var scaleX, var scaleY, var rotation, var red, var green, var blue, var alpha, var outlineRed, var outlineGreen, var outlineBlue):
Texts.TextImage.append(RichTextLabel.new())
add_child(Texts.TextImage[index])
var fontToUseIndex = 0
if fontSize == 25:
fontToUseIndex = 0
elif fontSize == 60:
fontToUseIndex = 1
Texts.TextImage[index].add_font_override("normal_font", FontTTF[fontToUseIndex])
Texts.TextImage[index].modulate = Color(red, green, blue, alpha)
FontTTF[fontToUseIndex].outline_size = 3
FontTTF[fontToUseIndex].outline_color = Color(outlineRed, outlineGreen, outlineBlue, alpha)
Texts.TextImage[index].text = text
var textWidth = Texts.TextImage[index].get_font("normal_font").get_string_size(Texts.TextImage[index].text).x
var textHeight = Texts.TextImage[index].get_font("normal_font").get_string_size(Texts.TextImage[index].text).y
Texts.TextImage[index].rect_global_position.x = x
Texts.TextImage[index].rect_global_position.y = (y - (textHeight / 2))
Texts.TextImage[index].set_size(Vector2(ScreenWidth, ScreenHeight), false)
Texts.TextImage[index].rect_pivot_offset = Vector2((textWidth / 2), (textHeight / 2))
Texts.TextImage[index].rect_scale = Vector2(scaleX, scaleY)
Texts.TextImage[index].rect_rotation = rotation
if horizontalJustification == 0:
Texts.TextImage[index].ALIGN_LEFT
elif horizontalJustification == 1:
Texts.TextImage[index].ALIGN_CENTER
Texts.TextImage[index].rect_global_position.x = ((VisualsCore.ScreenWidth/2) - (textWidth / 2))
elif horizontalJustification == 2:
Texts.TextImage[index].ALIGN_LEFT
Texts.TextImage[index].rect_global_position.x = (VisualsCore.ScreenWidth - x - (textWidth))
elif horizontalJustification == 4:
Texts.TextImage[index].ALIGN_LEFT
Texts.TextImage[index].rect_global_position.x = (x - (textWidth / 2))
else: Texts.TextImage[index].ALIGN_FILL
Texts.TextIndex.append(index)
Texts.TextScreenX.append(x)
Texts.TextScreenY.append(y)
Texts.TextHorizontalJustification.append(horizontalJustification)
Texts.TextSize.append(fontSize)
Texts.TextScaleX.append(scaleX)
Texts.TextScaleY.append(scaleY)
Texts.TextRotation.append(rotation)
Texts.TextColorRed.append(red)
Texts.TextColorGreen.append(green)
Texts.TextColorBlue.append(blue)
Texts.TextColorAlpha.append(alpha)
Texts.TextOutlineRed.append(outlineRed)
Texts.TextOutlineGreen.append(outlineGreen)
Texts.TextOutlineBlue.append(outlineBlue)
TextCurrentIndex+=1
pass