Widget: SimpleHTML

From AddOn Studio
Revision as of 01:52, 5 November 2007 by WoWWiki>WoWWiki-Fin (added note detailing how to set the font for different elements)
Jump to navigation Jump to search

Widget API < SimpleHTML

Supported HTML Mode Markup

If arguments are in square brackets, this means that they are optional.

Basic elements

  • <HTML>
  • <BODY>

Where the HTML element must be provided and must contain the BODY element.

The BODY element can contain block elements. Anything not contained within a block element is not displayed.

Block elements

  • <H1 [align="left|center|right"]>
  • <H2 [align="left|center|right"]>
  • <H3 [align="left|center|right"]>
  • <P [align="left|center|right"]>

Block elements can contain other block elements, inline elements and plain text. However other block elements will not be rendered (they will still be checked for valid html).

Inline elements

  • <A href="linkId">
  • <IMG src="imageSource" [width="x" height="y"]/>
  • <BR/>

Inline elements can contain other inline elements and plain text.

Example

<HTML><BODY>
  <H1>Foo</H1>
  <P>
    Bar<BR/>
    with stripes.
  </P>
</BODY></HTML>

Colouring Text

To colour text, use the standard |c notation colour escape sequences.

Using Different Fonts

It is possible to set different fonts for each HTML element (h1, h2, h3, h4, and p), using:

h1:SetFont()

(see the SetFont documenation for more details

You can also define font properties for these elements in your XML files, eg:

<FontStringHeader1 inherits="GameFontHighlightLarge"/>

Supported Plain Mode Escape Sequences

See UI Escape Sequences

Also See