draw.Text

From GMod Wiki

Jump to: navigation, search
Function
Syntax draw.Text( DrawText Details )
Where is this used?
Description:
Draws text from a table of values
Returns: Number width, Number height
Part of Library: Draw
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Draw.Text]Draw.Text [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionDraws 'Hello world' on the screen
Used onNewerClient.png
Code
 
local struc = {}
struc.pos = {}
struc.pos[1] = 100 -- x pos
struc.pos[2] = 200 -- y pos
struc.color = Color(255,0,0,255) -- Red
struc.text = "Hello World" -- Text
struc.font = "DefaultFixed" -- Font
struc.xalign = TEXT_ALIGN_CENTER -- Horizontal Alignment
struc.yalign = TEXT_ALIGN_CENTER -- Vertical Alignment
draw.Text( struc )
 
Output'Hello world' can be seen on the screen


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox