Caption text in our GUI is really quite robust. It is capable of including a number of formatting tags which are interpreted to change colour and font and nest images (called icons) into the text when the string is displayed onscreen.

font

You can change font within a caption using the [font="fontname"][/font] tag. Example:

  Hello [font="verdana16"]there [color="255 0 0"]I'm[/color][/font] here.

color

This uses a similar tag to [font]: [color="255 0 0"][/color]. (See example above.)

Currently colours must be specified in RGB format. Possibly we might provide the means to setup customised colour strings in a setup file in the future. (e.g. [color="black"], where "black" means "0 0 0").

icon

Icons are placed on the same lines as the text in the string. Icons will wordwrap when bundled up with text, making it perfectly possible to substitute icons for letters.

Note that just because it's called an icon, doesn't mean it has to be small. Icons can be large images between two paragraphs, a horizontal dividing bar, whatever.

To use an icon (declared in <setup.xml>; see icon) in text, use a [icon="<icon.name>"] tag in the appropriate text. For example:

  <object type="text">Here's the [icon="smiley"] I told you about.</object>

or

  object.caption = "Here's the [icon=\"smiley\"] I told you about.";

The displace property can also be used to cosmetically adjust the x and/or y position of the icon on the line, in case it needs to be shifted slightly to suit the surrounding text.

Example (icon will be moved 4 pixels to the left):

  object.caption = "Here's the [icon=\"smiley\" displace=\"-4 0\"] I told you about.";

imgleft / imgright

These tags are variants of the [icon] tag that can be used to display "floating images" ... icons that are aligned to either the left or the right. Example:

  object.caption = "Here's some[imgleft=\"ragnarok\"] text that will be [imgright=\"smiley\"]surrounded by images";

Note that the tag can go anywhere; it will be top-aligned with the text nearest to the tag (if the placement is displeasing, just try moving the tag somewhere else).

Last modified 9 years ago Last modified on Nov 16, 2014, 3:18:35 AM
Note: See TracWiki for help on using the wiki.