VASSAL Reference Manual
Home > Module > Game Piece Palette > Game Piece > Layer
Layer
A Layer is the standard trait for adding images, sub-images, and image-swapping functionality to game pieces in VASSAL. A Layer consists of a number of "levels", each of which has an image and a name. A Layer may be "active" or "inactive", and only active layers are drawn—a Layer can be activated with a key command, and players can change the current level during play. The image from the current level will be drawn whenever the Layer is active. The Layer is drawn on top the traits that appear before it in the piece’s list of traits.
While editing a layer, several keyboard shortcuts are available, including Alt+Enter to change the image of the currently selected level, Alt+I to jump focus to the list of levels, Alt+Insert to insert a level, Alt+Delete to delete the currently selected level, Alt+Up/Alt+Down to move the currently selected level up/down the list, and Alt+N to jump focus to the name field.
|
|
NOTES:
-
Leaving a Menu Command field blank means no entry appears in the right-click context menu, but you can still use a Keystroke or Named Command.
-
Key commands can be the same as those used by other traits. Pressing the key will perform all corresponding actions.
EXAMPLES:
-
For a basic two-sided counter, add a Layer, and select an image that represents the reverse side. Change "Activate" to "Flip" and set the key to Ctrl+F.
-
An alternative approach to the same two-sided counter: rather than give the counter an image in the Basic Piece trait, remove that and instead have two images (one for each side of the counter) here in the Layer trait. Check the Always Active and Loop Through Levels box. Change "Increase" to "Flip" and its key command to Ctrl+F.
-
To represent fatigue in an Army counter, give it a Layer named "Fatigue." Select Always Active, choose four images that represent the levels, and change "Increase" to "Increase Fatigue" and "Decrease" to "Decrease Fatigue". A Reset command named "Rest" using Ctrl+R could be used to bring the Army counter back to full strength. Name the levels " (fatigue 1)", etc., and check is suffix to append the current fatigue level to the piece’s name.
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.
EXAMPLE: A Layer named Manpower that is active and showing level 4 defined with image Man04.gif and name (strength 4) would have the following properties:
-
Manpower_Image = Man04.gif
-
Manpower_Name = (strength 4)
-
Manpower_Level = 4
-
Manpower_Active = true
These properties could be used in a Global Key Command to automatically remove all counters whose manpower was zero.