Creating XML Based Markers

This page describes the principles and implementation of the XML based marker system.

■ Markers: Basic Principles
OpenBVE supports two distinct types of markers:

1.   'Texture' based markers. This displays an image in the top right-hand corner of the screen.

2.   'Text' based markers. These add a textual message above the list of game messages in the upper left of the screen.

Each individual marker should be setup using a custom XML file, as per the examples below.

Image Based Markers:


Text Based Markers:

As you can see, the file is made up of either a <ImageMarker> section or a <TextMarker> section, which defines the properties of the marker itself.

If required, the base marker and / or the early & late markers may be omitted.
■ Common Attributes
The following attributes are supported by both image and text markers:
<Early> .... </Early>
Defines the marker used when the player is early.
This must contain a time and either an image or a textual string (See below).

<OnTime> .... </OnTime>
Defines the marker used when the player is early.
This must contain an image or a textual string (See below).

<Late> .... </Late>
Defines the marker used when the player is late.
This must contain a time and either an image or a textual string (See below).

<Distance> MarkerLength </Distance>
Defines the distance for which this marker will show.
MarkerLength represents the distance in meters for which to show the marker. Positive values will be displayed FROM where this marker is placed in the routefile. Negative values will be displayed BEFORE where this marker is placed in the routefile.

<Timeout> TotalTime </Timeout>
Defines the total time for which this marker will show.
TotalTime represents the maximum time in milliseconds for which this marker will be visible Note: This overrides Distance if it has not been reached.

<Trains> TrainList </Trains>
Defines the list of trains for which this marker will show.
TrainList must contain a semi-colon deliminated list of trains for which you wish to display this marker.

■ Textual Marker Attributes
<Text> DisplayText </Text>

DisplayText is the text which will be displayed on-screen.

<Color> TextColor </Color>

TextColor controls the color in which the message is renderered. The following colors are supported:

■ Image Marker Attributes
<Image> RelativePath </Image>

RelativePath is the relative on-disk path to the marker image.