GUI/TorqueML
From TDN
TorqueML is a markup language which allows one to dynamically change the style and formatting of text in certain Gui Controls. See the .hfl files included with the distribution for examples of usage.
Note: When specifying a color, you will use the format RRGGBB[AA], where RR is a 2-digit hexadecimal number signifying the Red, and where Green and Blue are specified similarly. The optional AA signifies the "alpha": an alpha of "00" is transparent, "FF" opaque.
The following markup tags are recognized:
- <font:name:size> Sets the current font to the indicated name and size. Example: <font:Arial Bold:20>
- <tag:ID> Set a tag to which we can scroll a GuiScrollContentCtrl (parent control of the guiMLTextCtrl)
- <color:RRGGBBAA> Sets text color. Example: <color:ff0000> will display red text.
- <linkcolor:RRGGBBAA> Sets the color of a hyperlink.
- <linkcolorHL:RRGGBBAA> Sets the color of a hyperlink that is being clicked.
- <shadow:x:y> Add a shadow to the text, displaced by (x, y).
- <shadowcolor:RRGGBBAA> Sets the color of the text shadow.
- <bitmap:filePath> Displays the bitmap image of the given file. Example: <bitmap:demo/client/ui/separator>
- <spush> ”Saves the current text formatting so that temporary changes to formatting can be made. Used with <spop>.
- <spop> Restores the previously saved text formatting. Used with <spush>.
- <sbreak> Produces line breaks, similarly to <br>. However, while <br> keeps the current flow (for example, when flowing around the image), <sbreak> moves the cursor position to a new line in a more global manner (forces our text to stop flowing around the image, so text is drawn at a new line under the image).
- <just:left> Left justify the text.
- <just:right> Right justify the text.
- <just:center> Center the text.
- <a:URL>content</a> Inserts a hyperlink into the text, which will open the user's browser. In the URL, the leading "http://" is understood. Example: <a:www.garagegames.com>Garage Games Website</a>. When the user clicks on the hyperlink text, GuiMLTextCtrl::onUrl(%this, %text) function is called. Your implementation can do whatever you want, including but not limited to opening the user's browser and navigating to the url.
- <lmargin:width> Sets the left margin.
- <lmargin%:width> Sets the left margin as a percentage of the full width.
- <rmargin:width> Sets the right margin.
- <rmargin%:width> Sets the right margin as a percentage of the full width.
- <clip:width>content</clip> Produces the content, but clipped to the given width.
- <div:bool> Use the profile's fillColorHL to draw a background for the text.
- <tab:##[,##[,##]]> Sets tab stops at the given locations.
- <br> Forced line break.
In Torque Game Builder (TGB) and Torque Game Engine (TGE), class GuiMLTextCtrl (and subclasses) appear to be unique in supporting TorqueML (ref. method reflow()).
Categories: TGE | TGB | GUI | TAP



