| 1 | 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. |
| 2 | |
| 3 | == font == |
| 4 | |
| 5 | You can change font within a caption using the ''[font="fontname"]![/font]'' tag. Example: |
| 6 | |
| 7 | {{{ |
| 8 | Hello [font="verdana16"]there [color="255 0 0"]I'm[/color][/font] here. |
| 9 | }}} |
| 10 | |
| 11 | == color == |
| 12 | |
| 13 | This uses a similar tag to [font]: ''[color="255 0 0"]![/color]''. (See example above.) |
| 14 | |
| 15 | 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"). |
| 16 | |
| 17 | == icon == |
| 18 | |
| 19 | 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. |
| 20 | |
| 21 | 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. |
| 22 | |
| 23 | To use an icon (declared in <setup.xml>; see [wiki:GUI_-_Custom_Objects#icon icon]) in text, use a ''[icon=<icon.name>]'' tag in the appropriate text. For example: |
| 24 | |
| 25 | {{{ |
| 26 | <object type="text">Here�s the [icon=smiley] I told you about.</object> |
| 27 | }}} |
| 28 | |
| 29 | or |
| 30 | |
| 31 | {{{ |
| 32 | object.caption = "Here�s the [icon=smiley] I told you about." |
| 33 | }}} |
| 34 | |
| 35 | 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. |
| 36 | |
| 37 | Example (icon will be moved 4 pixels to the left): |
| 38 | |
| 39 | {{{ |
| 40 | object.caption = "Here�s the [icon="smiley" displace="-4 0"] I told you about." |
| 41 | }}} |
| 42 | |
| 43 | == imgleft / imgright == |
| 44 | |
| 45 | 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: |
| 46 | |
| 47 | {{{ |
| 48 | object.caption = "Here's some[imgleft="ragnarok"] text that will be [imgright="smiley"]surrounded by images" |
| 49 | }}} |
| 50 | |
| 51 | 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). |