Garry's Mod Wiki


surface.DrawText( string text )


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.


1 string text
The text to be rendered.


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



Render Time: 38ms

DB GetPage 5
Generate Html 10
SaveChanges (1) 8
Render Body 0
Render Sidebar 13