DrawingImmediate.OutlinedText Synchronous

Draw text with a separately colored outline. Text and outline have independent opacity values. Use it for a readable label over a background that changes color. A dark outline can separate light text from the image behind it.

Syntax
Luau
DrawingImmediate.OutlinedText(
    position: Vector2,
    font: number | DrawFont | DrawingObject,
    size: number,
    color: Color3,
    opacity: number,
    outlineColor: Color3,
    outlineOpacity: number,
    text: string,
    center: boolean
) -> ()

Parameters

Function parameters
ParameterTypeDescription
positionVector2Upper-left anchor in screen pixels; centered text uses this as its horizontal center.
fontnumber | DrawFont | DrawingObjectFont identifier, registered DrawFont, or DrawingObject Font variant.
sizenumberFont size for this text submission in pixels.
colorColor3Color3 used for the primitive or text.
opacitynumberOpacity from 0 (invisible) to 1 (opaque).
outlineColorColor3Color of the text outline.
outlineOpacitynumberOutline opacity from 0 (invisible) to 1 (opaque).
textstringText to render.
centerbooleanWhether to center the text.

Returns

()

This function returns no values.

Usage notes

Immediate drawings last for one paint cycle. Call this function again from a GetPaint listener to keep the drawing visible; there is no object handle to update or remove.

Example

Example
Luau
local color = Color3.fromRGB(240, 150, 190)
local paint = DrawingImmediate.GetPaint()
local connection = paint:Connect(function()
    DrawingImmediate.OutlinedText(Vector2.new(40, 40), Drawing.Fonts.UI, 18, color, 1, Color3.new(0, 0, 0), 1, "Example label", false)
end)
task.wait(3)
connection:Disconnect() -- stop drawing this example
Kawaii documentation