TOOL:DrawToolScreen

From Garry's Mod
Jump to: navigation, search
 TOOL:DrawToolScreen( )

Contents

Description

Called after the default tool screen has been drawn.

NOTE If this method exists on the TOOL object table, the default scrolling text will not be drawn

Arguments

number width

The width of the tool's screen in pixels.

Arguments

number height

The height of the tool's screen in pixels.

Examples

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:



drawtoolscreen.jpg
Personal tools
Navigation