draw/SimpleText

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(TEXT -> TEXT_ALIGN)
Line 15: Line 15:
 
|name=font
 
|name=font
 
|desc=The font. See {{LibraryFunction|surface|CreateFont}} to create your own, or see [[Default Fonts]] for a list of default fonts.
 
|desc=The font. See {{LibraryFunction|surface|CreateFont}} to create your own, or see [[Default Fonts]] for a list of default fonts.
 +
|default="DermaDefault"
 
}}
 
}}
 
{{Arg
 
{{Arg
Line 20: Line 21:
 
|name=x
 
|name=x
 
|desc=The X Coordinate.
 
|desc=The X Coordinate.
 +
|default=0
 
}}
 
}}
 
{{Arg
 
{{Arg
Line 25: Line 27:
 
|name=y
 
|name=y
 
|desc=The Y Coordinate.
 
|desc=The Y Coordinate.
 +
|default=0
 
}}
 
}}
 
{{Arg
 
{{Arg
Line 30: Line 33:
 
|name=color
 
|name=color
 
|desc=The color of the text. Uses the {{Struct|Color}}.
 
|desc=The color of the text. Uses the {{Struct|Color}}.
 +
|default=Color( 255, 255, 255, 255 )
 
}}
 
}}
 
{{Arg
 
{{Arg

Revision as of 08:02, 6 July 2016

 draw.SimpleText( )

Contents

Description

Draws text on the screen.

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.
Personal tools
Navigation