linktree - Multiplayer Online Role Playing Game
Client Markup
Development -> Client MarkupClient Markup

Latest client supports new markup for almost all text. This markup effectively replaces the old "control characters" (read: hacks), like '~'. Eventually when the new client is released and 1.1.1 is deprecated, the "control characters" will no longer be stripped from chat messages.

The markup is similar to HTML, but it's less verbose and simpler. An example:

<font=sans.ttf 18><b><red>Hello World</red></b></font>

The above example would produce 18px Sans Bold "Hello World" string in red.

Error handling is currently very basic, but many things, especially unclosed tags, can cause problems. Some tags have their own rules, for example, <b> before <font> will not make the text after <font> bold.

Below is a list of currently supported tags.

Tag Syntax Description
<c> <c=#cccccc>hello</c>, <c=r,g,b>world</c> Changes the text color. HTML notation is supported (#cccccc), but integer RGB values are also supported (with the former being preferred).
<green> <green>string</green> Handy shortcut to make the text green instead of using <c>.
<yellow> <yellow>string</yellow> Handy shortcut to make the text yellow instead of using <c>.
<red> <red>string</red> Handy shortcut to make the text red instead of using <c>.
<blue> <blue>string</blue> Handy shortcut to make the text blue instead of using <c>.
<b> <b>bold</b> Makes the text bold.
<i> <i>italic</i> Makes the text italic.
<u> <u>underscore</u> Adds an underscore below the text.
<font> <font=serif.ttf 20>serif 20px text</font>, <font=sans.ttf>sans text</font>, <font=font name [size]>text</font> Changes the font used. All other font-related changes (such as <b>, <i>, etc - but not <c>) must happen inside this tag to be effective. The font size can be from 8 to 20, but not all sizes are possible (for example some fonts do not have odd-numbered pixel font sizes, such as 11px, 13px, etc). List of supported fonts:
arial.ttf: usually good for about any text.
serif.ttf: titles, etc.
<size> <size=20>text</size> Changes the currently used font's size.
<center> <center>centered text</center> Centers text to the middle.
<a> <a>quest</a>, <a=help>main</a>, <a=url></a>, <a=url:>Google</a>, <a=action:location>text</a> Creates text that the user can click on to trigger an action. The default (no action specified) is to say the clicked text (or location if specified). 'help' will open the help GUI, while 'url' will open user's default browser. The following would say the message 'test' when clicked, but show as 'xxx': <a=:test>xxx</a>
<y> <y=pixels>text</y> Adjusts the Y location where the text appears by 'pixels', which can be negative to make the text appear further up, or positive to make it appear further down.
NOTE: This tag's usage could make the line counts of text windows/book GUI/etc incorrect if used for larger adjustments, so it should be used with care (or at the very least in places where line counts are not calculated).
<x> <x=pixels>text</x> Adjusts the X location where the text appears by 'pixels', which can be negative to make the text appear further left, or positive to make it appear further right.
<img> <img=cheeseburger.101>, <img=face x y align alpha> Shows any face currently in the game. 'face' must be set, everything else is optional (but must be in order).
face: The face name, same as used by objects
x: X adjustment, can be 0
y: Y adjustment, can be 0
align: How to align the image. If 0, no align. If 1, align the image to the right. If 2, align the image to the top. If 3, align the image both to the right and to the top.
alpha: Alpha value, 0-255.
<o> <o=#cccccc>outline</o>, <o=r,g,b>another outline</o> Creates an outline around the text. This is useful to make text appear good on any surface, but also can be used for interesting effects. The color used can be in the same format as the <c> tag, but again, HTML notation is preferred.
<alpha> <alpha=123>alpha text</alpha> Sets opacity of text. Anti-aliasing is disabled on the text inside this tag.
<padding> <padding=pixels>padded text</padding> Pads the text horizontally by so many pixels.
<book> <book=The Lost Cheeseburgers>, <book>book title</book> Changes the main title of the currently displayed book (help/etc). Should only be used for text in the book GUI. The former syntax doesn't support any extra markup for the title, but the latter does.
<p> <p> Creates a straight line which is mostly used as a separator between pages in book GUI.
<title> <title>content title</title> Changes the font to 14px Serif with an underline, mostly used in book GUI.
&lt; &lt; Gets transformed into < character.
&gt; &gt; Gets transformed into > character.

Revision of text.c as of last update: r1931