This page describes the principles and implementation of the XML based marker system.
■ Markers: Basic Principles
openBVE supports two distinct types of markers:
- ‘Texture’ based markers. This displays an image in the top right-hand corner of the screen.
- ‘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:
Defines the marker used when the player is early.
This must contain a time and either an image or a textual string (See below).
Defines the marker used when the player is early.
This must contain an image or a textual string (See below).
Defines the marker used when the player is late.
This must contain a time and either an image or a textual string (See below).
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.
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.
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
DisplayText is the text which will be displayed on-screen.
TextColor controls the color in which the message is renderered. The following colors are supported:
- Black (Negre)
- Gray (Gris)
- White (Blanc)
- Red (Vermell)
- Orange (Taronja)
- Green (Verd)
- Blue (Blau)
- Magenta (Magenta)
■ Image Marker Attributes
RelativePath is the relative on-disk path to the marker image.
MarkerSize is a comma separated Vector2, controlling the rendered size in pixels of the marker on-scren.
If this is not set or is invalid, the rendered size of the marker will be the dimensions of the texture.