User Tools

Site Tools


Sidebar

Translations of this page:
en

Index

en:traffic:documentation:a2

[A: <AnimationRules>,<#><PictureName>,<TargetX>, <TargetY>,<FrameWidth>, <FrameHeight>, <SourceX>, <SourceY>,<%Time%>,<NumberOfFrames>,<StepX>, <StepY> ]

[A: <AnimationRules>, <PictureName>, <TargetX>, <TargetY> ]

[AT: <AnimationRules>,<#><PictureName>,<TargetX>, <TargetY>,<FrameWidth>, <FrameHeight>, <SourceX>, <SourceY>,<%Time%>,<NumberOfFrames>,<StepX>, <StepY> ]

[AT: <AnimationRules>, <PictureName>, <TargetX>, <TargetY> ]

Animation definition

Animations depict complex behaviors and have many various parameters associated with them.  Please read the following description carefully.

An animation is a sequence of individual pictures that are customarily placed into a single, larger picture with its own Stock List entry. The images are shown in sequence and the resulting sequential display of creates the illusion of motion.  Rules determine in what sequence the pictures are displayed and how fast the sequence is displayed.  They also determine where on a vehicle or foreground or background picture the animation is placed.  The parameter <AnimationRules> describe the direction, eventually the sequence these phase pictures will be copied on the vehicle or background/foreground element.

The individual pictures comprising each part of the motion in the animation which are customarily arranged in sequence inside a single picture.  This source picture consequently shows each position of the motion from start to finish.  Therefore, the source picture is usually have a width equal to <FrameWidth> * <NumberOfFrames> - each phase picture has it's own area, and the phase picture are near each other.  In most cases the parameters <SourceX> and <SourceY> have the value 0, because the first portion of the animation's usually is found in the leftmost corner.   <StepX> is equal to <FrameWidth> and <StepY> is customarily zero because the individual pictures usually stay near each other in the source picture.  There are, however, other possible ways to use the animation commands.  One can draw the phases of the animation in one picture appearing vertically rather than horizontally or one can even use specific portions of an animation picture as individual pictures.

Imagine if you will a sliding door which opens upward to reveal a homogeneous colour behind it (a dark colour perhaps, to represent the depths of a vehicle or building):  in this case it is sufficient to draw only the door and underneath it, a picture of the opening revealed when the door slides open.  The first stage (or “phase”) of the animation depicts the door closed.  The next shows the same picture one pixel below the first: one can see the first bit of the “inside” and as the animation progresses the original picture is shifted up each phase by one pixel, creating the illusion that the door is moving.  In this case, one would use the following parameters:

<SourceX> = 0

<SourceY> = <NumberOfFrames> - 1

<StepX> = 0

<StepY> = -1

This part, the geometric parameters, described the location of the phase pictures - they define a set of phase pictures numbered from 0 to <NumberOfFrames> - 1.  The following, the <AnimationRules>  determines how, in which sequence these individual component pictures are displayed during the animation.

Going back to the example we used at the beginning of this section, the short form of the animation [A: ] can be used when the remaining information required can be found in the macro attached to the picture <PictureName> in its Stock List entry.  If this is the case, the picture <PictureName> will have the following parameters defined in its Stock List entry macro lines:

[ANIM: <AnimationRules>, <FrameWidth>, <FrameHeight>, <SourceX>, <SourceY>, <%Time%>, <NumberOfFrames>, <StepX>, <StepY> ]

In order to be implemented, the only thing that is then required is to specify the coordinate values of where the animation is to be placed and to specify the name of the animation being placed.  When <EventName> is a single name and not a complex definition, the macro for the individual pictures can be described even more succinctly:

[ <EventName>: <FrameWidth>, <FrameHeight>, <SourceX>, <SourceY>, <%Time%>, <NumberOfFrames>, <StepX>, <StepY> ]

<PictureName> Picture composed of the individual pictures that make up the animation,  A name without slashes or periods defines a picture from the Stock List.  If a picture is called which is outside of the Stock List, it cannot be referenced with the short form of the command [A: ] as this command requires that the picture have macros associated with it which can only be attached to pictures in the Stock List.
If a # precedes the picture name, it means, that the picture will be mirrored before using it.
<TargetX>, <TargetY> The coordinates where the animation appears in the picture.

<FrameWidth>, <FrameHeight> - The width and height measurements of the individual pictures comprising the animation (so called “frames”) which is also the amount of space which will be covered with the animation if it is overlaid on another picture.  The individual frames of the animation must all be equally sized, regardless if the portion of the animation which depicts motion takes up the entire individual frame or not.  Therefore, the frame width and height for each individual frame must be as high as the highest portion of the motion and as wide as the widest portion of the motion.  For example, if you have an animation of a pantograph, the height of every frame in the animation must be as high as the highest position of the pantograph in its raised state and the width of the frame must be set to the widest width of the pantograph in its lowered state.

<SourceX>, <SourceY> The coordinates of the lower left corner of the first frame of the animation inside the animation picture <PictureName>, which contains all of the animation frames.
<%Time%> Time between the depiction of the individual frames in 10ms intervals. You can override this interval time for specific steps, if you use the program format of the <AnimationRules> parameter - see it there.
<NumberOfFrames> Number of individual frames comprising the animation.
<StepX>, <StepY> The distance in pixel of the frames from each other (to the right and up when positive values, to the left and down when negative values).  These two parameters enable one to use a particular part of an animation multiple times.  If, for example, you have a door which slides upward to reveal a background which is of one colour, you can draw the animation in only two frames, one depicting each state.  Then you can use the Step commands ( <StepX> = 0, <StepY> = -1) to “push” the door up as it opens.  In reality what is happening is that the step parameters are showing you a little more of the opening and less of the door by changing the relative position by one pixel what the “top” of the door in the animation is defined as.

The [AT: ] behaves similarly as the [A: ] modifier. The only difference: the phase pictures of the [AT: ] modifier will be placed before the base picture the modifier acts, the [A: ] modifier places the phase pictures instead of the part of the base picture - so, you can look through the transparent pixels of the [AT: ] modifier's picture to the base picture, in contrary, the phase pictures of the [A: ] modifier should contain the pixels of the base picture too, if inside the target square there are parts viewable from the base picture.

Animations can be triggered when a vehicle is at rest or when it passes predetermined waypoints.  They can also continue to run as the vehicle also begins moving or continues to move, respectively. Animations can be placed not only on vehicles, but on foreground or background elements too. For starting the animations, see the syntax element <WaitTime> and the chapter Actions.

This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.
More information
en/traffic/documentation/a2.txt · Last modified: 2018/09/09 17:50 (external edit)