markup.Parse

From GMod Wiki

Jump to: navigation, search
Function
Syntax markup.Parse( String markup, Number (optional) max width )
Where is this used?
Description:
Parses markup text so it can be used in VGUI elements
Returns: Table :MarkupObject
Part of Library: markup
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Markup.Parse]Markup.Parse [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionPrint a nice google link on the center of the screen
Used onNewerClient.png
Code
 
 
local google = markup.Parse( "<color=black>www.</color>"
                          .. "<color=blue>g</color><color=red>o</color>"             
                          .. "<color=yellow>o</color><color=blue>g</color>"
                          .. "<color=green>l</color><color=red>e</color>" 
                          .. "<color=black>.com</color>" )
 
local function drawGoogle()
  google:Draw( (ScrW() / 2) - (google:GetWidth() / 2), (ScrH() / 2) - (google:GetHeight() / 2) )
end
hook.Add("HUDPaint", "drawGoogle", drawGoogle)
 
 
OutputN/A


Tags Supported

Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox