JTraffic Screensaver



<FgBg> == <FgBgElem> ( <FgBgList> )
<FgBgList> == <FgBgElem> <FgBgList> ; <FgBgElem>
<FgBgElem> == <PicList> : <FgBgPlace>
<PicList> : <FgBgPlace> , <VertPos>
<PicList> : <FgBgPlace> , <VertPos> , <Phase>  
<PicList> : <FgBgPlace> , <VertPos> , , FIT  
<PicList> : <FgBgPlace> , <VertPos> , # , <SideFill>  
<PicList> : <FgBgPlace> , <VertPos> , # , <LeftFill> , <RightFill>
<PicList> == <PicElem> <PicList> , <PicElem>
<SideFill> == <PicList>
<LeftFill> == <PicList>

<RightFill> == <PicList>

<PicElem> == <PictureName> <PicElem> <Modifier> <Distance>

<FgBgPlace> == <Place> || <Place> .. <Place>

<VertPos> == <Place>
<Distance> == <Integer>
<Phase> == <Integer> #

A rather complex parameter which determines and controls foreground, background and temporary backgroun pictures.

Multiple individual pictures must be separated by a comma: <PicList> == <PicElem> || <PicList> , <PicElem>;. Multiple <FgBgElem> values can be grouped together, but they must be separated from each other by a semicolon and then the entire ( <FgBgList> ) must be enclosed in parentheses (to avoid to interpret the semicolon as the end of the whole <FgBg> parameter rather then the end of a single  .

The part <PicList> is a list of picture names, which are separated from each other by a comma: <PicList> , <PicElem>. The pictures are laid out in a left-right sequence, and will be placed tightly near each other.  Each picture in the <PicList> can contain modification commands in hard brackets, exactly as with vehicles.   The modifications only apply to the picture they directly follow. On the place of the picture names one can use an integer number. It means an empty place on that position - the distance of the two neighboring pictures will be determined, without the need to use a transparent 1x1 pixel wide picture.

The <FgBgList> construction creates a single, combined picture from it's components. This picture can be

  • placed a single time somewhere on the line - you may fix the position of the left side, right side or the middle of the combined picture.
  • a part of it is placed somewhere - you have to define the left and right side's positions too, if the whole combined picture doesn't fit into the area, the side(s) will but cut.
  • repeated between to points. The first repetition should not start on the left position of the combined picture - you can determine, where to start. For example a repeated catenary combined from a pillar and a wire only picture has not start always with the pillar, you can determine an inner point to start there (of course, this point can be determined by a random number).
  • placed a single time somewhere, and the place to a point on the left and to a point on the right can be filled with a second, or with a second and third combined picture.
  • if it fits between two points, to place it there, if it doesn't fit, then to resize the picture, that the whole picture will be shown (usefull for logos, texts).

The <FgBgPlace> construction is either a simple <Place> value or can be specified as an area by <Place> .. <Place> (two <Place> values connected by two periods).  In this case the picture will be displayed exactly in the middle of the area defined between the two coordinates.  If the picture is wider than the space specified, then it will be cropped to fit.  If it is narrower than the area, it will be repeated enough times to fit.  The characters <, > and * preceding the number determine the reference point on the picture (left, right and middle, respectively) which is used to place it in the available space. Do not forget, that the <Place> syntax element can be composed from a percentual and an pixel part. The percentual part describes the position in percentage of the screen width or the area width, if it was decreased by a DX=; parameter. The  exact part uses pixel as measurement unit.

With these possibilities one can develop background scenery which is independent of the screen width or resolution settings.

If the interval format is used, the default value for the left position is the left side of the line, the default value for the right side is the right side of the line ( the width of the line can be shorter as the screen width, if the movement or one of the enclosing segmentation commands have a DX= ; parameter ). The two points alone mean the whole line - suitable for trackbad, catenary, sky, gras and similar background element, which should fill the whole width.

The <Phase> parameter can be a single # character too. If the 4. parameter ( <SideFill> or <LeftFill> ) fails, it means a fully random phase - the starting point is selected somewhere in the combined picture.

Some pictures perhaps should fit an area, but the main picture cannot be repeated or shown from the middle - as a main building of a factory, or a special point in the catenary - the change of the wires, or the switch box for the lead-in of the current. The formats

<PicList> : <Place> .. <Place> , <VertPos> , # , <SideFill>

<PicList> : <Place> .. <Place> , <VertPos> , # , <LeftFill> , <RightFill>

place the combined picture given by the <PicList> parameter somewhere between the two delimiting positions given by the <Place> parameters. The remaining space on the left and on the right of the combined picture will be filled by the single <SideFill> combined picture, or on the left side by the <LeftFill> combined picture and on the right side by the <RightFill> combined picture. The picture on the left will be right-aligned (the right side will be connected to the base combined picture, the beginning will be determined by the width of the space), the picture on the right will be left-aligned.



The picture SAVTE_FG for a SAVTE interurban is repeated as often as necessary to cover the entire width of the screen.  In the above example, the omission of the two starting and ending points is equivalent to setting these values as the screen edges: ( 0+0) is the default value for the left-hand coordinate and ( 100+0) is the default for the right-hand coordinate.  The foreground picture is displayed 42 pixels beneath the track on which the train runs, because in this case the foreground picture depicts a bridge.

If you wish to experiment by using the above example in a Timetable file, you should not forget to modify the BELOW= and ABOVE= parameters which determine the amount of space on the screen which a Movement (and its foregrounds and/or background pictures) can occupy.  These can be in either the $SECTION, $GROUP or $LINE commands or in the Timetable file header if you do not use any of the Sections, Group or Line commands. Additionally, you should explicitly set the roadbed parameter to W=X; in the Movement itself so that Traffic doe not use the default roadbed, namely, the simple line for a roadbed and a simple line for the catenary wire.


Two signals of the same type are placed in close proximity to each other on the screen, at 30% of the screen width.  The first is for trains travelling right to left and is offset from the 30% point by 4 pixels.  The second signal is mirrored with [M] as it is intended for trains travelling from left to right.  Its right side is offset to the left of the 30% point by 4 pixel  so that the two signals end up being 8 pixels away from each other.  Both signals are  set 4 pixels beneath the surface of the top of the rail, making them appear to be fixed in the ground on which the track is.  Because the signals should appear to be on opposite sides of the track, one is input as foreground an the other background.


3*(PLF1C,5*PLF11,PLF1V,5*PLF11,PLF1T,5*PLF11,PLF1V,5*PLF11), \


Let's take a look at a station platform!  The PLF.. pictures are pieces of a station platform.  The primary element  is in the middle line: a sequence of individual pictures and pictures which are always repeated five times next to each other, each of which consisting of a piece of platform and a piece of platform with a post. This grouping is repeated three times in succession and in this way makes up the part of the platform which is covered with a canopy.   The pictures which comprise the first and last lines depict the ends of the canopy as well as the parts of the platform which are not covered by the canopy.  The entire platform as a unit  is placed with its middle aligned to the centre of the screen: *50 means 50% of the screen width, without any offset.  The anchor of the platform is 3 pixels below the top of the rail.

As you can use for all the repetition counts, element selections and placements (positions) random choices, one can write foreground and background expressions delivering various background pictures.

The Configuration Window
Program Window
Stock List
Description Editor
Graphic Testpad
Timetable Editor
Timetable Syntax and Semanics
The timetable header
Sections, Groups, Lines, Scenes
Stock List File