draw.SimpleText

From Garry's Mod
Jump to: navigation, search
 draw.SimpleText( )

Contents

Description

Draws text on the screen.

NOTE

This is a rendering function that requires a 2D rendering context.
This means that it will only work in hooks with a 2D rendering context.

Arguments

string text

The text to be drawn.

Arguments

string font="DermaDefault"

The font. See surface.CreateFont to create your own, or see Default Fonts for a list of default fonts.

Arguments

number x=0

The X Coordinate.

Arguments

number y=0

The Y Coordinate.

Arguments

table color=Color( 255, 255, 255, 255 )

The color of the text. Uses the Color structure.

Arguments

number xAlign=TEXT_ALIGN_LEFT

The alignment of the X coordinate using TEXT_ALIGN_ Enums.

Arguments

number yAlign=TEXT_ALIGN_TOP

The alignment of the Y coordinate using TEXT_ALIGN_ Enums.

Returns

number

The width of the text. Same value as if you were calling surface.GetTextSize.

Returns

number

The height of the text. Same value as if you were calling surface.GetTextSize.

Examples

Example

Example usage

hook.Add( "HUDPaint", "HelloThere", function()
	draw.SimpleText( "Hello there!", "DermaDefault", 50, 50, color_white )
end )


Personal tools
Navigation