Structures/TextData

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
 
(15 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
{{Structure
 
{{Structure
| Description = Used for {{LibraryFunction|draw|Text}}.
+
|Description=Used for {{LibraryFunction|draw|Text}}.
| Fields =
+
|Fields={{StructureField|string|text|Text to be drawn.}}{{StructureField|string|font|The font to draw with. List of default fonts can be found [[Default_Fonts|here]].|"DermaDefault"}}{{StructureField|table|pos|This holds the X and Y coordinates. Key value 1 is x, key value 2 is y.}}{{StructureField|number|xalign|The alignment of the X position. See {{Enum|TEXT_ALIGN}}|TEXT_ALIGN_LEFT}}{{StructureField|number|yalign|The alignment of the Y position. See {{Enum|TEXT_ALIGN}}|TEXT_ALIGN_TOP}}{{StructureField|table|color|The text color|color_white}}
{{StructureField|string|text|Text to be drawn.}}
+
{{StructureField|string|font|The font to draw with.}}
+
{{StructureField|number|x|The X Coordinate.}}
+
{{StructureField|number|y|The Y Coordinate.}}
+
{{StructureField|number|xalign|The Alignment of the X position.}}
+
{{StructureField|number|yalign|The Alignment of the Y position.}}
+
{{StructureField|Color|color|The text color}}
+
 
}}
 
}}
 
== Additional Notes ==
 
* Default font is DermaDefault.
 
* Default text color is Color(255,255,255,255).
 
* Default xAlign is TEXT_ALIGN_LEFT
 
* Default yAlign is TEXT_ALIGN_TOP
 
* Any other fields default to 0.
 
* For a list of fonts that still work with the update look [[Talk:Libraries/surface/SetFont|here]].
 
* xAlign must be [[Enums/TEXT|TEXT_ALIGN_*]] enums.
 

Latest revision as of 09:35, 8 April 2017

Used for draw.Text.



Type Name Description
string text

Text to be drawn.

string font

The font to draw with. List of default fonts can be found here.

Default: "DermaDefault"

table pos

This holds the X and Y coordinates. Key value 1 is x, key value 2 is y.

number xalign

The alignment of the X position. See TEXT_ALIGN_ Enums

Default: TEXT_ALIGN_LEFT

number yalign

The alignment of the Y position. See TEXT_ALIGN_ Enums

Default: TEXT_ALIGN_TOP

table color

The text color

Default: color_white

Personal tools
Navigation