UIStroke

Show Deprecated

UIStroke applies an outline to text or a UI border. Key features include:

  • Adjust the Color and Thickness of the stroke outline.
  • Change the stroke Transparency independently from the text or UI object.
  • Choose the LineJoinMode of the stroke (round, bevel, or miter).
  • Add a gradient to the stroke via the UIGradient instance.
  • Use rich text tags to add stroke to inline text segments.

For more details on the UIStroke object, see Appearance Modifiers.

Summary

Properties

Properties

ApplyStrokeMode

Read Parallel

When a UIStroke instance is applied to a text object, the ApplyStrokeMode property determines whether to apply the stroke to the object's border instead of the text itself.

ApplyStrokeMode = Contextual
ApplyStrokeMode = Border

Color

Read Parallel

Determines the UIStroke color. You can also insert a UIGradient instance as a child to create gradient strokes.

Color = (0, 95, 225)
UIStroke with UIGradient child

Enabled

Read Parallel

This property determines whether the UIStroke is visible. When set to false, the stroke will not be rendered. Defaults to true.

LineJoinMode

Read Parallel

This property determines how corners are interpreted. It accepts an Enum.LineJoinMode value of either Round (default), Bevel, or Miter.

LineJoinMode = Round
LineJoinMode = Bevel
LineJoinMode = Miter

Thickness

Read Parallel

This property determines the stroke's thickness, measured in pixels from the parent's outer edges.

Thickness = 4
Thickness = 12

Be mindful of tweening this UIStroke property when applied to text objects. This renders and stores many glyph sizes each frame, potentially causing performance issues or text flickering.

Transparency

Read Parallel

The Transparency property sets the stroke opacity independently of the parent object's BackgroundTransparency or TextTransparency. This allows you to render text and borders that are "hollow" (consisting of only an outline).

Transparency = 0.5  ·  TextLabel.TextTransparency = 0
Transparency = 0  ·  TextLabel.TextTransparency = 1

Methods

Events