Added Section 'Creation Using Pure LUA'
(→Well-formed HTML: split code) |
(Added Section 'Creation Using Pure LUA') |
||
| Line 43: | Line 43: | ||
<FontStringHeader1 inherits="GameFontHighlightLarge"/> | <FontStringHeader1 inherits="GameFontHighlightLarge"/> | ||
</SimpleHTML> | </SimpleHTML> | ||
==Creation Using Pure LUA== | |||
Creating a SimpleHTML object using pure LUA is very simple. | |||
MySimpleHTMLObject = CreateFrame('SimpleHTML'); | |||
After, the creation of the object you can assign the HTML code to be displayed. But, there is one more required step! | |||
MySimpleHTMLObject:SetText('<html><body><h1>Heading1</h1><p>A paragraph</p></body></html>'); | |||
For the SimpleHTML object to actual render the HTML code you gave it (or plain text) a font must be set. | |||
MySimpleHTMLObject:SetFont('Fonts\\FRIZQT__.TTF', 11); | |||
The literal number 11 specifies the size of the font. | |||
==Example== | ==Example== | ||