|
|
| Line 1: |
Line 1: |
| <includeonly><span class="growsprite" style="{{ | | <includeonly>https://vignette.wikia.nocookie.net/growtopia/images/8/8f/{{{image|ItemSprites.png}}}/revision/latest/window-crop/width/{{{size|32}}}/x-offset/{{#expr:{{{pos|0}}} mod {{{rowlen|32}}}}}/y-offset/{{#expr:floor({{{pos|0}}}/{{{rowlen|32}}})}}/window-width/{{{size|32}}}/window-height/{{{size|32}}}</includeonly> |
| #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> | |