|
|
| (34 intermediate revisions by 3 users not shown) |
| Line 1: |
Line 1: |
| <includeonly><span class="growsprite" style="{{ | | <includeonly>{{#invoke:Item|Sprite|{{{1}}}}}</includeonly><noinclude>{{documentation}}</noinclude> |
| #ifeq: {{{size|32}}} | 32 || height: {{{size}}}px; width: {{{size}}}px; }} {{
| |
| #if: {{{align|}}} | vertical-align: {{{align}}} }}"><span style="{{ | |
| #ifeq: {{{sheetsize|512}}} | 512 || height: {{{sheetsize}}}px; width: {{{sheetsize}}}px; }} {{Sprite/pos|{{{pos|0}}}|{{{size|32}}}|{{{sheetsize|512}}}}}">[[File:{{{image|ItemSprites.png}}}|link={{{link|}}}]]</span></span></includeonly><noinclude>
| |
| Displays a sprite out of a spritesheet image. Used when a lot of small images are needed. Based on the [http://www.minecraftwiki.net/wiki/Template:Sprite Minecraft Wiki].
| |
| | |
| == Examples ==
| |
| <pre>
| |
| {{Sprite
| |
| |pos=1
| |
| |align=text-top
| |
| |image=ItemSprites.png
| |
| |link=Dirt
| |
| |size=32
| |
| |sheetsize=512
| |
| }}
| |
| </pre>
| |
| gives: {{Sprite
| |
| |pos=1
| |
| |align=text-top
| |
| |image=ItemSprites.png
| |
| |link=Dirt
| |
| |size=32
| |
| |sheetsize=512
| |
| }}
| |
| | |
| {| class="wikitable"
| |
| ! Parameter
| |
| ! Function
| |
| ! Default value
| |
| |-
| |
| | <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 as 0) || 0
| |
| |-
| |
| | <code>align</code> || Sets the [http://css-tricks.com/what-is-vertical-align/ vertical alignment] of the image to the text. || middle
| |
| |-
| |
| | <code>image</code> || Sprite sheet image, without prefix || [[:File:ItemSprites.png|ItemSprites.png]]
| |
| |-
| |
| | <code>link</code> || Create a link to this page || ''None''
| |
| |-
| |
| | <code>size</code> || Size of each sprite in pixels, width and height || 32
| |
| |-
| |
| | <code>sheetsize</code> || Size of the whole sheet in pixels, width and height, must be multiple of <code>size</code> || 512
| |
| |-
| |
| |}
| |
| </noinclude> | |
| Template Documentation [Edit] [History] [Purge]
|
| This is the documentation of Template:Sprite.
|
Description:
Display the corresponding image of an item.
Usage:
{{Sprite|ItemName}}
Example: