Garry's Mod Wiki

draw

The draw library's purpose is to simplify the usage of the surface library.

Methods

draw.DrawText( string text, string font = "DermaDefault", number x = 0, number y = 0, table color = Color( 255, 255, 255, 255 ), number xAlign = TEXT_ALIGN_LEFT )
Simple draw text at position, but this will expand newlines and tabs. This is a rendering function that requires a 2d rendering context. This means that it will only work in 2d Rendering Hooks. See also MarkupObject for limited width and markup support.
number draw.GetFontHeight( string font )
Returns the height of the specified font in pixels. This is a rendering function that requires a 2d rendering context. This means that it will only work in 2d Rendering Hooks.
draw.NoTexture()
Sets drawing texture to a default white texture (vgui/white) via surface.SetMaterial. Useful for resetting the drawing texture. This is a rendering function that requires a 2d rendering context. This means that it will only work in 2d Rendering Hooks.
draw.RoundedBox( number cornerRadius, number x, number y, number width, number height, table color )
Draws a rounded rectangle. If you intend to draw a non-rounded rectangle, then it's more efficient to use surface.DrawRect.This is a rendering function that requires a 2d rendering context. This means that it will only work in 2d Rendering Hooks.
draw.RoundedBoxEx( number cornerRadius, number x, number y, number width, number height, table color, boolean roundTopLeft = false, boolean roundTopRight = false, boolean roundBottomLeft = false, boolean roundBottomRight = false )
Draws a rounded rectangle. This function also lets you specify which corners are drawn rounded. This is a rendering function that requires a 2d rendering context. This means that it will only work in 2d Rendering Hooks.
number, number draw.SimpleText( string text, string font = "DermaDefault", number x = 0, number y = 0, table color = Color( 255, 255, 255, 255 ), number xAlign = TEXT_ALIGN_LEFT, number yAlign = TEXT_ALIGN_TOP )
Draws text on the screen. This function does not handle newlines properly. See draw.DrawText for a function that does.This is a rendering function that requires a 2d rendering context. This means that it will only work in 2d Rendering Hooks.
number, number draw.SimpleTextOutlined( string Text, string font = "DermaDefault", number x = 0, number y = 0, table color = Color( 255, 255, 255, 255 ), number xAlign = TEXT_ALIGN_LEFT, number yAlign = TEXT_ALIGN_TOP, number outlinewidth, table outlinecolor = Color( 255, 255, 255, 255 ) )
Creates a simple line of text that is outlined. This is a rendering function that requires a 2d rendering context. This means that it will only work in 2d Rendering Hooks.
number, number draw.Text( table textdata )
Works like draw.SimpleText but uses a table structure instead. This is a rendering function that requires a 2d rendering context. This means that it will only work in 2d Rendering Hooks.
draw.TextShadow( table textdata, number distance, number alpha = 200 )
Works like draw.Text, but draws the text as a shadow. This is a rendering function that requires a 2d rendering context. This means that it will only work in 2d Rendering Hooks.
draw.TexturedQuad( table texturedata )
Draws a texture with a table structure. This is a rendering function that requires a 2d rendering context. This means that it will only work in 2d Rendering Hooks.
number, number draw.WordBox( number bordersize, number x, number y, string text, string font, table boxcolor, table textcolor )
Draws a rounded box with text in it. This is a rendering function that requires a 2d rendering context. This means that it will only work in 2d Rendering Hooks.

Page Links


Special Pages


Wikis

?

Render Time: 26ms

DB GetPage 2
Generate Html 3
SaveChanges (1) 11
Render Body 0
Render Sidebar 7