Garry's Mod Wiki

surface.DrawText

surface.DrawText( string text )

Description

Draw the specified text on the screen, using the previously set position, font and color.

This function does not handle newlines properly
This is a rendering function that requires a 2d rendering context.

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

Arguments

1 string text
The text to be rendered.

Example

Draws 'Hello World' on the screen. All functions in this example must be called for the draw to work flawlessly.

hook.Add( "HUDPaint", "drawsometext", function() surface.SetFont( "Default" ) surface.SetTextColor( 255, 255, 255 ) surface.SetTextPos( 128, 128 ) surface.DrawText( "Hello World" ) end )

Page Links


Special Pages


Wikis

?

Render Time: 25ms

Session 0
DB GetPage 4
Generate Html 3
SaveChanges 10
Render Body 0
Render Sidebar 6