Hi,
Having trouble with text outline below?
Let us know how to fix this, thanks!
Jesse
VisualsCore.DrawText(VisualsCore.TextCurrentIndex, "Made With 100% FREE:", 0, 100, 1, 60, 1.0, 1.0, 0, 0.6, 0.6, 0.6, 1.0, 1.0, 0.0, 0.0) //Should be red outline, but outline is black?
#----------------------------------------------------------------------------------------
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].rect_clip_content = false
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].rect_global_position.x = x
elif horizontalJustification == 1:
Texts.TextImage[index].rect_global_position.x = ((VisualsCore.ScreenWidth/2) - (textWidth / 2))
elif horizontalJustification == 2:
Texts.TextImage[index].rect_global_position.x = (VisualsCore.ScreenWidth - x - (textWidth))
elif horizontalJustification == 4:
Texts.TextImage[index].rect_global_position.x = (x - (textWidth / 2))
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
#----------------------------------------------------------------------------------------