Skip to content

ShowText

march edited this page Jan 8, 2025 · 5 revisions

Creates a named text object in the environment.

Properties

Time:number

⠀⠀⠀⠀The time the text object starts fading in.

Length:number (default 0.5)

⠀⠀⠀⠀The time it takes for the text object to fade-in.


Name:string

⠀⠀⠀⠀The unique identifier for the text object.


Text:string

⠀⠀⠀⠀The text shown. If Markup isn't present, this will be used.

Markup:string

⠀⠀⠀⠀Markup variant of Text. Overrides Text.


Position:vector

⠀⠀⠀⠀The position of this text object. The behavior of this is defined by the Dimension property.

Dimension:string (must be '3D', '2D')

⠀⠀⠀⠀The dimension of this text object. 2D mode means that the Position property's X and Y components are used as the coordinates for the text. 3D mode means the text object will point towards a 3D position (again, based on the Position property).

PositionRelativeToScreen:boolean

⠀⠀⠀⠀Only works when using '2D' for the Dimension property. Means that the X and Y components of the Position property are treated as multipliers to ScrW() and ScrH(). Makes it easy to center two-dimensional text to the screen, for example.


Horizontal:TEXT_ALIGN

⠀⠀⠀⠀The X-coordinate position alignment.

Vertical:TEXT_ALIGN

⠀⠀⠀⠀The Y-coordinate position alignment.

TextAlignment:TEXT_ALIGN

⠀⠀⠀⠀The X-coordinate alignment of the text itself.

The Garry's Mod wiki page on MarkupObject:Draw best explains this.

Clone this wiki locally