SetTextOutline
Description
Adds an outline effect around text. The outline appears as a border around the text characters, which can significantly improve text readability over busy or similar-colored backgrounds.
function SetTextOutline(red, green, blue) --[[ ... ]] end
Parameters
red
:number
- (Optional) The red color component for the outline (0-255). Defaults to black if not specifiedgreen
:number
- (Optional) The green color component for the outline (0-255). Defaults to black if not specifiedblue
:number
- (Optional) The blue color component for the outline (0-255). Defaults to black if not specified
Return Values
None.
Example
-- Add a black outline (default)
SetTextOutline()
SetTextPosition(0.5, 0.3)
SetTextScale(1.5)
SetTextColor(255, 255, 255, 255)
DrawText("White text with black outline")
-- Add a white outline for dark text
SetTextOutline(255, 255, 255) -- White outline
SetTextPosition(0.5, 0.5)
SetTextColor(0, 0, 0, 255) -- Black text
DrawText("Black text with white outline")
-- Colored outline
SetTextOutline(255, 0, 255) -- Magenta outline
SetTextPosition(0.5, 0.7)
SetTextColor(0, 255, 0, 255) -- Green text
DrawText("Green text with magenta outline")