PcoWSkbVqDnWTu_dm2ix
Collapse Sidebar

TextStrokeColor3

TextBox

Color3

The TextStrokeColor3 property sets the color of the stroke, or outline, of rendered text. This property and TextBox/TextStrokeTransparency determine the visual properties of the text stroke.

Text stroke is rendered before normal text and is simply 4 renderings of the same text in +/- 1 pixel offsets in each direction. Text stroke rendering works independently and identically to TextBox/TextColor3 and TextBox/TextTransparency.


Code Samples


Text Highlight Oscillation

This code sample oscillates a TextLabel’s TextStrokeTransparency so that it blinks the highlight of a text.

local textLabel = script.Parent

-- How fast the highlight ought to blink
local freq = 2

-- Set to yellow highlight color
textLabel.TextStrokeColor3 = Color3.new(1, 1, 0)

while true do
	-- math.sin oscillates from -1 to 1, so we change the range to 0 to 1:
	local transparency = math.sin(workspace.DistributedGameTime*math.pi*freq)*.5+.5
	textLabel.TextStrokeTransparency = transparency
	wait()
end