Garry's Mod Wiki

draw.Text

  number, number draw.Text( table textdata )

Description

Works like draw.SimpleText but uses a table structure instead.

This is a rendering function that requires a 2d rendering context.

This means that it will only work in 2d Rendering Hooks.

Arguments

1 table textdata
The text properties. See the TextData structure

Returns

1 number
Width of drawn text
2 number
Height of drawn text

Example

Example usage

hook.Add( "HUDPaint", "drawTextExample", function() draw.Text( { text = "test", pos = { 50, 50 } } ) end )