Modifications
m
Switch documentation page template
{{documentation header}}
<!-- Documentation here -->
{{lua}}
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 ==
<pre>
{{Sprite
|pos=1
|align=text-top
|image=BlockCSS.png
|link=Grass Block
|text=Grass
|size=16
|sheetsize=256
}}
</pre>
gives: {{Sprite
|pos=1
|align=text-top
|image=BlockCSS.png
|link=Grass Block
|text=Grass
|size=16
|sheetsize=256
}}
{| class="wikitable"
! Parameter
! Function
! Default value
|-
| <code>align</code> || Sets the [http://css-tricks.com/what-is-vertical-align/ vertical alignment] of the image to the text. || middle
|-
| <code>class</code> || Add additional classes to .sprite || ''None''
|-
| <code>css</code> || Add styling to .sprite || ''None''
|-
| <code>defaultpos</code> || The default position used if no position is set. || 1
|-
| <code>image</code> || Sprite sheet image, without prefix || ''None''
|-
| <code>link</code> || Create a link to this page || ''None''
|-
| <code>name</code>
| Sets the name for this spritesheet, used to:
# get the position definitions: Module:Sprite/<name>
# part of the classname if it's in the imgClasses table: <code><name:lower>-sprite</code>
# part of the image name, if <code>image</code> isn't set: <code><name>Sprite.png</code>
| ''None''
|-
| <code>pos</code> || Position index of the sprite, depends on <code>size</code> and <code>sheetsize</code> (left to right, starting at top-left sprite) || <code>defaultpos</code>
|-
| <code>scale</code> || Scale the sprite larger or smaller || 1
|-
| <code>sheetsize</code> || Width of the whole sheet in pixels. Must be multiple of <code>size</code> || 256
|-
| <code>size</code> || Size of each sprite in pixels, width and height || 16
|-
| <code>text</code> || Show some text after the sprite, if <code>link</code> is set, this text will also be linked. || ''None''
|-
| <code>title</code> || Set a title to be displayed when hovering over the sprite or text, overrides the link's title. || ''None''
|}
== See also ==
{{Sprite see also}}
<includeonly>
<!-- Template categories/interwiki here -->
[[Category:Sprite templates]]
[[fr:Modèle:Sprite]]
</includeonly>
<noinclude>
<!-- Documentation categories/interwiki here -->
[[fr:Modèle:Sprite/doc]]
</noinclude>
<!-- Documentation here -->
{{lua}}
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 ==
<pre>
{{Sprite
|pos=1
|align=text-top
|image=BlockCSS.png
|link=Grass Block
|text=Grass
|size=16
|sheetsize=256
}}
</pre>
gives: {{Sprite
|pos=1
|align=text-top
|image=BlockCSS.png
|link=Grass Block
|text=Grass
|size=16
|sheetsize=256
}}
{| class="wikitable"
! Parameter
! Function
! Default value
|-
| <code>align</code> || Sets the [http://css-tricks.com/what-is-vertical-align/ vertical alignment] of the image to the text. || middle
|-
| <code>class</code> || Add additional classes to .sprite || ''None''
|-
| <code>css</code> || Add styling to .sprite || ''None''
|-
| <code>defaultpos</code> || The default position used if no position is set. || 1
|-
| <code>image</code> || Sprite sheet image, without prefix || ''None''
|-
| <code>link</code> || Create a link to this page || ''None''
|-
| <code>name</code>
| Sets the name for this spritesheet, used to:
# get the position definitions: Module:Sprite/<name>
# part of the classname if it's in the imgClasses table: <code><name:lower>-sprite</code>
# part of the image name, if <code>image</code> isn't set: <code><name>Sprite.png</code>
| ''None''
|-
| <code>pos</code> || Position index of the sprite, depends on <code>size</code> and <code>sheetsize</code> (left to right, starting at top-left sprite) || <code>defaultpos</code>
|-
| <code>scale</code> || Scale the sprite larger or smaller || 1
|-
| <code>sheetsize</code> || Width of the whole sheet in pixels. Must be multiple of <code>size</code> || 256
|-
| <code>size</code> || Size of each sprite in pixels, width and height || 16
|-
| <code>text</code> || Show some text after the sprite, if <code>link</code> is set, this text will also be linked. || ''None''
|-
| <code>title</code> || Set a title to be displayed when hovering over the sprite or text, overrides the link's title. || ''None''
|}
== See also ==
{{Sprite see also}}
<includeonly>
<!-- Template categories/interwiki here -->
[[Category:Sprite templates]]
[[fr:Modèle:Sprite]]
</includeonly>
<noinclude>
<!-- Documentation categories/interwiki here -->
[[fr:Modèle:Sprite/doc]]
</noinclude>