Garry's Mod Wiki

TOOL:DrawToolScreen

  TOOL:DrawToolScreen( number width, number height )

Description

Called after the default tool screen has been drawn from WEAPON:RenderScreen.

If this method exists on the TOOL object table, the default scrolling text will not be drawn
Materials rendered in this hook require $ignorez parameter to draw properly.

Arguments

1 number width
The width of the tool's screen in pixels.
2 number height
The height of the tool's screen in pixels.

Example

White text that says "Hello world!" on a black background.

function TOOL:DrawToolScreen( width, height ) -- Draw black background surface.SetDrawColor( Color( 20, 20, 20 ) ) surface.DrawRect( 0, 0, width, height ) -- Draw white text in middle draw.SimpleText( "Hello world!", "DermaLarge", width / 2, height / 2, Color( 200, 200, 200 ), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER ) end
Output: