Template:SchematicSprite/doc

This template displays a block sprite built from one or more pieces of the following sprite sheet:



Usage
SchematicSprite takes up to two parameters:

The sprite parameter is a +-delimited list of sprite layer definitions:


 * a single character (or an HTML character entity reference, such as  for  ) simply displays the character
 * a sprite identifier (such as ) displays a predefined sprite
 * a sprite specification (e.g., ) displays any rectangular portion of the sprite sheet, possibly with flips, rotations, or transparency.

The size parameter specifies the width and height of the sprite in pixels, either as a number (e.g., ) or a CSS length value expressed in pixels (e.g.,  ).

Sprite identifiers
Flips, rotations, and opacity cannot be applied to a layer defined with a sprite identifier. Find the sprite identifier in Template:SchematicSprite/specs, apply the desired transformations to each segment of the identifier's specifications, and use that as an argument to the template. Consider adding a new identifier to /specs with your transformations applied, and using the new identifier.

Sprite specifications
A spite specification consists of up to eight values separated by commas (any may be empty or omitted) which define which portion of SchematicSprite.png is to be displayed, how it is to be positioned within the sprite's bounding box, and what transformations should be applied to it:

sheetX, sheetY, boxWidth, boxHeight, boxX, boxY, transform, opacity


 * sheetX, sheetY: distance in pixels from top-left corner of SchematicSprite.png to top-left corner of image portion to be displayed (defaults to 0,0)
 * boxWidth, boxHeight: width and height of image portion to be displayed (defaults to 16,16)
 * boxX, boxY: distance in pixels from top-left corner of sprite bounding box to top-left corner of image portion to be displayed (defaults to 0,0)
 * transform: flips and rotations to be applied to image portion (all reflections and rotations are around center of sprite bounding box) &mdash; only specific values are permitted/understood (defaults to no transformation):
 * H: flip horizontally
 * V: flip vertically
 * 90: rotate 90 degrees counter-clockwise
 * 180: rotate 180 degrees counter-clockwise
 * 270: rotate 270 degrees counter-clockwise
 * 90H: flip horizontally, then rotate 90 degrees counter-clockwise (identical to 270V)
 * 180H: flip horizontally, then rotate 180 degrees counter-clockwise (identical to V)
 * 270H: flip horizontally, then rotate 270 degrees counter-clockwise (identical to 90V)
 * 90V: flip vertically, then rotate 90 degrees counter-clockwise (identical to 270H)
 * 180V: flip vertically, then rotate 180 degrees counter-clockwise (identical to H)
 * 270V: flip vertically, then rotate 270 degrees counter-clockwise (identical to 90H)


 * opacity: a number between 0.0 (completely transparent) and 1.0 (no transparency, the default).

Specify all lengths (the first six values) without transformation (i.e., as if to a 16px sprite with no reflections or rotations) &mdash; the template will take care of applying transformations to the values specified. For example, even if you have specified a size parameter of 32px, specify sheetX and sheetY in terms of the regularly sized sprite sheet, and specify boxWidth, boxHeight, boxX, and boxY in terms of a 16&times;16px box.

Stacked sprites
Sprites can be stacked on top of each other by specifying the layers separated by plus signs, from bottom to top.

Examples
Red borders have been added to some sprites to clarify size and positioning of internal elements.