markup.Parse

From Garry's Mod
Jump to: navigation, search
 markup.Parse( )

Contents

Description

Parses markup into a MarkupObject. Currently, this only supports fonts and colors as demonstrated in the example.

Arguments

string markup

The markup to be parsed.

Arguments

number maxwidth

The max width of the output

Returns

MarkupObject

parsed

Examples

Example

Renders a markup string on the HUD.

local parsed = markup.Parse("<font=Default>changed font</font>\n<colour=255,0,255,255>changed colour</colour>")

hook.Add("HUDPaint", "MarkupTest", function()
 parsed:Draw(100, 100, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end)

Output:



Screenshot-2012-08-30 13.13.59.png
Personal tools
Navigation