draw.WordBox

From GMod Wiki

Jump to: navigation, search
Function
Syntax draw.WordBox( Number Bordersize, Number X, Number Y, String Text, String Font, Color Color, Table Fontcolor )
Where is this used?
Description:
Draws text in a box. You can choose the font, corner curve (bordersize), box colour and font colour.
Returns: nil
Part of Library: Draw
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Draw.WordBox]Draw.WordBox [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionPrints text in the center of the screen.
Used onNewerClient.png
Code
 
function paint()
draw.WordBox( 8, ScrW() / 2, ScrH() / 2, "THIS IS A BOX!", "Default", Color(50,50,75,100), Color(255,255,255,255) )
end
hook.Add( "HUDPaint", "TestPaint", paint )
 
OutputGmhud3.png



DescriptionShows your health on a WordBox.
Used onNewerClient.png
Code
 
function PaintWordBox()
draw.WordBox( 8, 5, ScrH() / 2, "Health: "..LocalPlayer():Health(), "ScoreboardText", Color(255,100,100,200), Color(255,255,255,255))
end
hook.Add( "HUDPaint", "WordBoxPaint", PaintWordBox )
 
OutputGmhud2.png
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox