Garry's Mod Wiki

Garry's Mod Wiki

  surface.SetTextPos( number x, number y )

Description

Set the top-left position to draw any future text at.

Arguments

1 number x
The X integer co-ordinate.
2 number y
The Y integer co-ordinate.

Example

Draws 'Hello World' on the screen, around top-left of the screen.

hook.Add( "HUDPaint", "HUDPaint_DrawABox", function() surface.SetDrawColor( 0, 0, 0, 128 ) -- Set color for background surface.DrawRect( 100, 100, 128, 20 ) -- Draw background surface.SetTextColor( 255, 255, 255 ) -- Set text color surface.SetTextPos( 136, 104 ) -- Set text position, top left corner surface.SetFont( "Default" ) -- Set the font surface.DrawText( "Hello World" ) -- Draw the text end )

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...