Difference between revisions of "Template:Sprite/doc"
(Created page with "{{doc/start}} This template creates a sprite from a sheet image. Commonly used when many small images are displayed on one page to reduce the total amount of HTTP connections. =...") |
(→Examples) |
||
Line 15: | Line 15: | ||
give: {{Sprite | give: {{Sprite | ||
|pos=1 | |pos=1 | ||
+ | |align=text-top | ||
+ | |image=BlockCSS.png | ||
+ | |link=grass | ||
+ | |size=16 | ||
+ | |sheetsize=256 | ||
+ | }}______________________________________________________________________{{Sprite | ||
+ | |pos=112 | ||
+ | |align=text-top | ||
+ | |image=BlockCSS.png | ||
+ | |link=grass | ||
+ | |size=16 | ||
+ | |sheetsize=256 | ||
+ | }}____________________________________________________________________________________{{Sprite | ||
+ | |pos=289 | ||
|align=text-top | |align=text-top | ||
|image=BlockCSS.png | |image=BlockCSS.png |
Latest revision as of 11:25, 11 May 2019
This template creates a sprite from a sheet image. Commonly used when many small images are displayed on one page to reduce the total amount of HTTP connections.
Examples
{{Sprite |pos=1 |align=text-top |image=BlockCSS.png |link=Grass |size=16 |sheetsize=256 }}give: ______________________________________________________________________ ____________________________________________________________________________________
Parameter | Function | Default value |
---|---|---|
pos |
Position index of the sprite, depends on size and sheetsize (left to right, starting at top-left sprite) |
1 |
align |
Sets the vertical alignment of the image to the text. | middle |
image |
Sprite sheet image, without prefix | BlockCSS.png |
link |
Create a link to this page | None |
size |
Size of each sprite in pixels, width and height | 16 |
sheetsize |
Size of the whole sheet in pixels, width and height, must be multiple of size |
256 |
This is the documentation page, it should be transcluded into the main template page. See Template:Doc for more information.