VASSAL Reference Manual
Home > Module > Game Piece Palette > Game Piece > Can Rotate
This trait allows a piece to be rotated through an arbitrary number of facings. You can choose the number of valid facings. For example, a hex-based game may have 6 (or possibly 12) possible facings, while a game with a square grid game might have 4 or 8.
Alternatively, you can allow any arbitrary facing. In this case, selecting the Rotate command will change the cursor and let the user drag the cursor to select the facing of the piece interactively.
An optional additional command will rotate the piece to a random facing (in one of the valid facings, if applicable).
|The Can Rotate trait will rotate only those traits that appear above it in the list of traits for a Game Piece. Traits below the "Can Rotate" trait will be drawn on top of the rotated image.|
|Since the rotations are created on the fly from a bitmapped image, the image quality of a rotated counter may be lower than the unrotated version. Alternatively, you may get better image quality for your rotations by creating separate images for each rotation in an external paint program (If your images are based on vector objects, you can rotate them without degrading quality) and putting them into different levels of a Layer.|
A Can Rotate trait with 6 set facings
The same trait configured to rotate freely
A Can Rotate trait defines a number of Properties. In the name of the properties, <Rotator_name> is the Rotator Name specified in the trait configuration.
<Rotator_name>_Facing returns the current facing if the number of facings is fixed. The value is an integer that ranges from 1 (the original, un-rotated state) to the number of allowed facings. For example, if the number of facings is 4, then this property returns a value from 1 to 4. Facing numbers increase in a clockwise direction.
<Rotator_name>_Degrees returns the current rotation angle if arbitrary rotations are allowed. Rotation degrees increases in a clockwise direction.