ManiaLink Page
From TM Wiki
Contents |
Introduction
This page is intended as an overview for the ManiaLink tags, which you need to be aware of to set up proper ManiaLink pages on your own.
The tags are derived from XML. The old manialinks style (TMUnited) was in fact pretty limited, but Forever style manialinks permit many more things, easier, and nicer !
Some tags take attributes to further define what and how the page's content is displayed.
Old style (United) manialinks : The Tags
='*' means the attribute takes a number, integer or floating point. Try to experiment until you get a feeling for the right size. ='2' is huge.
='RGBA' means a RedGreenBlue code with additional alpha code for the blending. FFFF is opaque white while FFF5 is transparent white with the background visible. FFF0 is invisible white, because it is fully transparent.
XML Header
-
<?xml version="1.0" encoding="UTF-8"?>
Every ManiaLink page should begin with this header.
XML Comment
-
<!-- Your comment about this page or code here -->
The optional comment where you can put in info about author, contents etc.
You can put comments anywhere in the page documenting the code, links or other contents etc.
Basic Tags
-
<manialink> ... </manialink>
The main tag which needs to surround everything except the XML header. Start and end your ManiaLink page with this tag.
In the closed beta test this tag had been called <manianet> .
-
<manialinks> ... </manialinks>
A new tag for Forever, this group tag bundles more than one <manialink> into the same page (e.g. for sending to the dedicated server).
-
<type> default </type>
The type of the page to follow. The standard here is default .
-
<format> ... </format>-
textsize='*' -
textfilter='*'
-
With this tag you can set some defaults for the page such that you don't have to repeat them later with every tag.
-
<background> ... </background>-
bgcolor='RGBA' -
bgborderx='*' -
bgbordery='*'
-
You have guessed it already. This tag defines the background of the page.
Formatting Tags
-
<line> ... </line>-
height='*' -
bgcolor='RGBA'
-
With the line and cell tags you define a grid on your page, in which you place the page's content.
A page must contain one or more lines.
Lines will adapt to the height of their content if no specific height is given as attribute.
-
<cell> ... </cell>-
width='*' -
bgcolor='RGBA'
-
With the line and cell tags you define a grid on your page, in which you place the page's content.
Any line must contain one or more cells. Cells are being placed one by one in a row on their pertaining line.
Cells will adapt to the width of their content if no specific width is given as attribute.
The most simple page you can do is a page with one line, which contains one cell.
Content Tags
-
<text> ... </text>-
textsize='*' -
textcolor='RGBA' -
valign='top|center|bottom' -
halign='left|center|right' -
action='*'
-
The tag to contain text.
For line breaks do line breaks in the text. There is no markup for it.
-
<icon> http://my.web.space/Trackmania/my_little_picture.jpg </icon>-
width='*' -
height='*' -
valign='top|center|bottom' -
halign='left|center|right'
-
The tag to contain graphics. The *.jpg and *.png formats are known to work with it.
-
<video> http://my.web.space/Trackmania/my_little_video.bik </video>-
width='*' -
height='*' -
valign='top|center|bottom' -
halign='left|center|right' -
play='0|1'
-
The tag to contain video. The *.bik format is known to work with it.
-
<audio> http://my.web.space/Trackmania/my_little_song.ogg </audio>-
width='*' -
height='*' -
valign='top|center|bottom' -
halign='left|center|right' -
play='0|1'
-
The tag to contain audio. The *.ogg, *.wav and *.mux formats are known to work with it.
Details on the many other new tags in Forever can be found here.
Other Codes
- Hyperlinks
Hyperlinks are formatted with text tags.
To link internally to another ManiaLink page, use $h. This will open the page in-game.
$h[http://127.0.0.1/Trackmania/links.xml]Links$h
To link externally, use $l. This will open the page in your standard web browser.
$l[http://en.tm-wiki.org/Stunt_Mode]TM Wiki: Stunt Mode$l
New in Forever, to link with player information to a script, use $p. This will open the returned ManiaLink in-game (see here for more info).
$p[http://127.0.0.1/path/to/script.php]Get Player Info$p
- Trackmania Text Formatting Codes
You can use Trackmania text codes to overwrite the XML setting for text. These codes you would normally use for track names or online nickname work in ManiaLink pages as well. See the Nickname Formatting page for all the formatting and color codes.
Old style (United) manialinks : Example Page
Here is an example of a complete page. A screenshot of the page resulting from this code is shown below.
<?xml version="1.0" encoding="utf-8" ?>
<!-- tmx ohei2 is the author of this page -->
<manialink>
<type>default</type>
<format textsize='1' textcolor='FFFF'></format>
<background bgcolor='FFFF' bgborderx='1' bgbordery='1'></background>
<line>
<cell bgcolor='8585' width='2.1'>
<text halign='center' valign='center' textsize='6'>Stunts: Alley Oop</text>
</cell>
</line>
<line height='0.05'>
<cell bgcolor='8585' width='0.05'>5
<text halign='center' valign='center' textsize='1'>$h[http://127.0.0.1/Trackmania/stunts.xml]<<$h</text>
</cell>
<cell bgcolor='0000' width='1.96'></cell>
</line>
<!-- Dummy line to keep the headline on the top -->
<line height='0.125'>
<cell bgcolor='0000' width='2'></cell>
</line>
<line>
<cell bgcolor='ffff' width='1.8'>
<text halign='center' valign='center' textsize='8' textcolor='000'>$wAlley Oop</text>
</cell>
</line>
<line height='0.1'>
<cell bgcolor='fc08' width='1.8'>
<text halign='center' valign='center' textsize='3' textcolor='000'>A vertical jump with the car spinning against the direction of the jump.</text>
</cell>
</line>
<!-- Dummy line -->
<line height='0.09'>
<cell bgcolor='0000' width='2'></cell>
</line>
<line>
<cell bgcolor='8585'>
<video halign='center' height='0.45' play='0' width='0.6'>http://127.0.0.1/Trackmania/Straight%20Alley%20Oop%201260.bik</video>
</cell>
</line>
<line>
<cell bgcolor='ffff'>
<text halign='center' valign='center' textsize='1' textcolor='000'>A Straight Alley Oop 1260
performed by Marius 89 on Nadeo's GiantPinball. (=>$h[http://united.tm-exchange.com/main.aspx?action=trackshow&id=36924]TM$f00X$h$z)</text>
</cell>
</line>
<!-- Dummy line -->
<line height='0.09'>
<cell bgcolor='0000' width='2'></cell>
</line>
<line>
<cell bgcolor='ffff'>
<text halign='center' valign='center' textsize='3' textcolor='000'>Related stunts: $h[http://127.0.0.1/Trackmania/aerial.xml]Aerial$h</text>
</cell>
</line>
<!-- Dummy line to keep the quick links menu on the bottom -->
<line height='0.14'>
<cell bgcolor='0000' width='2'></cell>
</line>
<line height='0.04'>
<cell bgcolor='0000' width='1.96'></cell>
<cell bgcolor='8585' width='0.05'>
<text halign='center' valign='center' textsize='1'>$h[http://127.0.0.1/Trackmania/next.xml]>>$h</text>
</cell>
</line>
<line height='0.095'>
<cell bgcolor='8585' width='1'></cell>
<cell bgcolor='8585'>
<text halign='center' valign='center' textsize='6'>$h[http://127.0.0.1/Trackmania/tips.xml]Tips$h</text>
</cell>
<cell bgcolor='8585'>
<text halign='center' valign='center' textsize='6'> $s-$z </text>
</cell>
<cell bgcolor='8585'>
<text halign='center' valign='center' textsize='6'>$h[http://127.0.0.1/Trackmania/links.xml]Links$h</text>
</cell>
<cell bgcolor='8585'>
<text halign='center' valign='center' textsize='6'> $s-$z </text>
</cell>
<cell bgcolor='8585'>
<text halign='center' valign='center' textsize='6'>$h[http://127.0.0.1/Trackmania/mytracks.xml]Tracks$h</text>
</cell>
<cell bgcolor='8585'>
<text halign='center' valign='center' textsize='6'> $s-$z </text>
</cell>
<cell bgcolor='8585'>
<text halign='center' valign='center' textsize='6'>$h[http://127.0.0.1/Trackmania/myskins.xml]Skins$h</text>
</cell>
<cell bgcolor='8585' width='1'></cell>
</line>
</manialink>
... and the resulting page
Forever manialinks : The Tags
Note: old style manialinks tags still work also on Forever ! some tags values specified previously are not indicated here, but can be used.
<music>
info :
ambient music (without start/stop button)
attributes :
data = "http://localhost/tmu/bigbisous.ogg"
note: must be directly in <manialink> and not in a <frame> !
<frame>
info :
component container. wich you can position easily
attributes :
pos = "0 0 0" // position x,y and z-buffer (high value in front)
// left: -1.0, top: -0.75, right: +1.0, bottom: +0.75, rear: +1.0, front: -1.0
or posn = "0 0 0" // position in menu-coordinate, -64,+48 to +64,-48
// left: -64, top: +48, right: +64, bottom: -48, rear: -48, front: +48
// it seems that old style manialinks have a z-buffer = 2.62
scale = "1.0" // scale all the contents of the frame (<1 to reduce, >1 to grow)
<format>
info :
change the current format for the components of the current frame and its sub frames.
each component can override this format by its own format attributes.
attributes :
textsize = "3" // text size 1(small),2,3,4,5...
textcolor="0f0f" // text color
or
style = "TextStaticSmall" // style presets used used in game menus
<label>
info :
draw a string
attributs :
size = "0.3 0" // size of the component
or sizen = "10 4" // in menu-coordinate system
// height is useless. will be splitted in several line if too long for width, then clipped
pos = "0 0 0" // position
or posn = "0 0 0" // position in menu-coordinate system
halign = "center" // horizontal alignment : "left", "right" or "center"
// (specify where is the pos/posn for the text)
valign = "center" // vertical alignment : "top", "bottom" or "center"
// (specify where is the pos/posn for the text)
text = "blabla" // label text
textid = "language text tag" // dico language text tag (see <dico>)
autonewline="1" // split the text when lines are too long
scale = "1.0" // scale the object (<1 to reduce, >1 to grow)
+ <format> attributes
<entry>
info :
text input field. the value can be added to manialink/web links
attributs :
size = "0.3 0.1" // size of the component
pos = "0 0 0" // position
textsize = "3" // text size
halign = "center" // horizontal alignment: "left", "right" ou "center"
name = "inputname" // text input name (usefull for links: will be replace by the input value)
default = "blabla" // default value
+ <format> attributes
<fileentry>
info :
filename input field. the file can be sent to a link using POST
attributs :
size = "0.3 0.1" // size of the component
pos = "0 0 0" // position
textsize = "3" // text size
halign = "center" // horizontal alignment: "left", "right" ou "center"
name = "inputname" // text input name (usefull for links: will be replace by the input value)
default = "blabla" // default value
<quad>
info :
draw a rectangular zone with a color or image, and optionally a link
attributs :
size="0.25 0.25"
pos="-1 0 0"
halign="right"
valign="center"
scale = "1.0" // scale the object (<1 to reduce, >1 to grow)
image="http://localhost/tmu/image.tga" // image to draw
imagefocus="http://localhost/tmu/imagefocus.tga" // image to draw when focus is onto it
style="Bgs1" // name of the presets styles of the game (use it if you don't use image="...")
substyle="BgWindow1" // subname of the preset style
url="http://www.google.fr" // associated web link
manialink="http://mywebserver/go.xml" // associated manialink link (opened in manialinkbrowser)
maniazone="http://www.google.fr" // associated maniazone link (opened in maniazone part)
action="100" // server manialink only, will make a PlayerManialinkPageAnswer() callback
actionkey="1" // server manialink only, binds the action to a key (1,2,3 for F5,F6,F7 keys)
addplayerid="1" // identified link (add &playerlogin=xxx) (also $p or $P in links text)
<include>
info :
add to the manialink xml code the contents off another xml file from a valid url.
note: it seems that only the first tag (and subtags) in the file will be used.
attributs :
url = "./included.xml"
<timeout>
info :
specify a interval delay for automatic reload of resource from the url.
(classic usage for a dynamic page: <timeout>0</timeout> )
<redirect>
info :
allow an automatic redirection to an other ressource.
attributs :
none
use :
<redirect>MyOtherAddress</redirect>
<dico>
info :
permit to set automatic language texts, each tag can be use in label
textid attribut which will be replaced by its value in the right game language.
subtag : <language>
attributs : id="en" // indicate the language of subtags
example, example1 and example2 would be usable as textid values :
<dico>
<language id="en">
<example1>Example text number1</example1>
<example2>Example text number2</example2>
</language>
<language id="fr">
<example1>Exemple de texte 1</example1>
<example2>Exemple de texte 2</example2>
</language>
</dico>
Forever manialinks : online server secific tags
These are only for manialinks sent by the serveur to online game client (ie using the server SendDisplayManialinkPage method)
<manialinks>
<manialink posx="" posy ="" id="">
....
</manialink>
<manialink posx="" posy ="" id="">
....
</manialink>
<custom_ui>
<notice visible="true"/> // notices
<challenge_info visible="true"/> // upper right challenge info
<net_infos visible="true"/> // top left number of player ???
<chat visible="true"/> // chat box
<checkpoint_list visible="true"/> // bottom right checkpoint list (of first 6 players)
<round_scores visible="true"/> // no right round score panel at the end of rounds
<scoretable visible="true"/> // no score tables at end of rounds/runs/map
<global visible="true"/> // all
</custom_ui>
</manialinks>
<custom_ui> stays unchanged if not specified.
if no pages are displayed, the <custom_ui> returns to the default "all visibles".
When a new Manialink page is received:
- previously displayed <manialink> with the same id as one in the new page are replaced.
- previously displayed <manialink> without an id are deleted
- previously displayed <manialink> with an id are kept.
- a new empty <manialink> with an id means delete the previously displayed <manialink> with this id.
Forever manialinks : Styles and Substyles
After long search, Smurf made a great example page for Styles and Substyles (for quads and labels) !
You can see it in TMUF browser at 'example' or 'exemple', or in TMNF browser at this address: http://smurf1.free.fr/mle/index.xml
Note: some styles/substyles have different colors in TMUF and TMNF...
Forever manialinks : Examples
A Nadeo's manialink example : http://files.trackmaniaforever.com/ManialinkSamples.zip
Also, there are some interesting Nadeo examples are in the directory GameData\Manialinks\ of the game...


