VASSAL Reference ManualHome > Module > Game Piece Palette > Game Piece > Layer |
|||
Layer
|
A Layer is the basic method for adding functionality to game pieces in VASSAL. A Layer consists of a number of 'levels,' each of which has an image and a name. The Layer can be activated with a keyboard command, and players can change the current level during play. The image from the current level will be drawn whenever the Layer is activated. The Layer is drawn on top the traits that appear before it in the list of traits Name: The name of this Layer, used for reference during editing and as the prefix for the name of any Properties defined by this Layer. Always Active: If checked, then this layer is always active. I.e., the current layer will always be displayed. If unchecked, then the layer must be activated (by the specified keyboard command) in order to display the current layer. Underneath when highlighted: If checked, then this layer will be drawn underneath the rest of the piece when the counter has been highlighted (by clicking on it). Loop through levels: If checked, then increasing the level past the last one will loop through to the first level and vice versa. Otherwise, increasing the level has no effect if the current level is the last level. Offset: The images of a level are drawn with their center offset from the center of the underlying piece by a number of pixels specified by the "offset" boxes, with positive numbers giving an offset down and to the right. For example, if a layer image is 40x40 pixels and you want it to be drawn so that the lower-left corner is at the center of the GamePiece, set the offset to 20,-20. Levels follow Property Value: If selected, then you can specify the name of a Property that will determine the active level, rather than responding directly to keyboard events. A typical use will use the name of a Dynamic Property. You can also specify the numeric value of the property that should correspond to the first level of this Layer. Activate/Increase/Decrease: Specify the keyboard commands and right-click menu text that will activate the Layer and increase or decrease the current level. The Activate keyboard shortcut can specify a string of characters, such that the layer is activated only when all the corresponding keys have been pressed. The Increase/Decrease keyboard shortcuts can also specify a string of characters, such that the level is increased/decreased when any one of the keys is pressed. Reset to level: Specifies a keyboard command that resets the Layer to a specified level. This does not automatically activate the Layer. Randomize: Specifies a keyboard command that sets the Layer to a random level. Level Images: Specify the image to be shown for each layer by double-clicking or selecting from the drop-down menu. An image can be left blank to display nothing for that level. Using transparency in the images can be very useful. Level Name: Each level can be given an individual name, which is used to change the name of the piece for reporting purposes during play. The level's name either replaces the piece's normal name, or else modifies the piece's normal name as a prefix or suffix. Note:
A Layer defines a number of Properties. In the name of the properties, <layer_name> is the name of the overall Layer as specified in the top field of the properties.
|