|
|
Line 4: |
Line 4: |
| --><span class="border"><!-- | | --><span class="border"><!-- |
| --><span>{{#if: {{{default|}}} | <span class="default-image">[[File:Grid {{{default}}}.png|32px|alt=|link=]]</span>}}<!-- | | --><span>{{#if: {{{default|}}} | <span class="default-image">[[File:Grid {{{default}}}.png|32px|alt=|link=]]</span>}}<!-- |
− | | + | --> {{Grid2/Crafting Square Slide|{{{1|}}}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}} <!-- |
− | -->{{#ifeq: {{#pos: {{{1}}} | ; }} | | <!-- Not Animated
| |
− | --> {{Grid2/Cell|{{{1|}}}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}} <!--
| |
− | | |
− | --> | <span class="animated"><!-- Animated, up to 16 frames
| |
− | | |
− | -->{{Grid2/Cell|{{#explode: {{{1}}} | ; }}|imgclass=active|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}}<!-- 1st frame | |
− | | |
− | -->{{Grid2/Cell|{{#explode: {{{1}}} | ; | 1 }}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}}<!-- 2nd frame
| |
− | | |
− | -->{{#if: {{#vardefineecho:f3 |{{#pos: {{{1}}} | ; | {{#expr: {{#pos: {{{1}}} | ; }} + 1 }} }}}} |<!--
| |
− | -->{{Grid2/Cell|{{#explode: {{{1}}} | ; | 2 }}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}} }}<!-- 3rd frame
| |
− | | |
− | -->{{#if: {{#vardefineecho:f4 |{{#if: {{#var:f3 }} | {{#pos: {{{1}}} | ; | {{#expr: {{#var:f3 }} + 1 }} }} }}}} |<!--
| |
− | -->{{Grid2/Cell|{{#explode: {{{1}}} | ; | 3 }}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}} }}<!-- 4th frame
| |
− | | |
− | -->{{#if: {{#vardefineecho:f5 |{{#if: {{#var:f4 }} | {{#pos: {{{1}}} | ; | {{#expr: {{#var:f4 }} + 1 }} }} }}}} |<!--
| |
− | -->{{Grid2/Cell|{{#explode: {{{1}}} | ; | 4 }}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}} }}<!-- 5th frame
| |
− | | |
− | -->{{#if: {{#vardefineecho:f6 |{{#if: {{#var:f5 }} | {{#pos: {{{1}}} | ; | {{#expr: {{#var:f5 }} + 1 }} }} }}}} |<!--
| |
− | -->{{Grid2/Cell|{{#explode: {{{1}}} | ; | 5 }}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}} }}<!-- 6th frame
| |
− | | |
− | -->{{#if: {{#vardefineecho:f7 |{{#if: {{#var:f6 }} | {{#pos: {{{1}}} | ; | {{#expr: {{#var:f6 }} + 1 }} }} }}}} |<!--
| |
− | -->{{Grid2/Cell|{{#explode: {{{1}}} | ; | 6 }}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}} }}<!-- 7th frame
| |
− | | |
− | -->{{#if: {{#vardefineecho:f8 |{{#if: {{#var:f7 }} | {{#pos: {{{1}}} | ; | {{#expr: {{#var:f7 }} + 1 }} }} }}}} |<!--
| |
− | -->{{Grid2/Cell|{{#explode: {{{1}}} | ; | 7 }}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}} }}<!-- 8th frame
| |
− | | |
− | -->{{#if: {{#vardefineecho:f9 |{{#if: {{#var:f8 }} | {{#pos: {{{1}}} | ; | {{#expr: {{#var:f8 }} + 1 }} }} }}}} |<!--
| |
− | -->{{Grid2/Cell|{{#explode: {{{1}}} | ; | 8 }}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}} }}<!-- 9th frame
| |
− | | |
− | -->{{#if: {{#vardefineecho:f10|{{#if: {{#var:f9 }} | {{#pos: {{{1}}} | ; | {{#expr: {{#var:f9 }} + 1 }} }} }}}} |<!--
| |
− | -->{{Grid2/Cell|{{#explode: {{{1}}} | ; | 9 }}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}} }}<!-- 10th frame
| |
− | | |
− | -->{{#if: {{#vardefineecho:f11|{{#if: {{#var:f10}} | {{#pos: {{{1}}} | ; | {{#expr: {{#var:f10}} + 1 }} }} }}}} |<!--
| |
− | -->{{Grid2/Cell|{{#explode: {{{1}}} | ; | 10 }}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}} }}<!-- 11th frame
| |
− | | |
− | -->{{#if: {{#vardefineecho:f12|{{#if: {{#var:f11}} | {{#pos: {{{1}}} | ; | {{#expr: {{#var:f11}} + 1 }} }} }}}} |<!--
| |
− | -->{{Grid2/Cell|{{#explode: {{{1}}} | ; | 11 }}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}} }}<!-- 12th frame
| |
− | | |
− | -->{{#if: {{#vardefineecho:f13|{{#if: {{#var:f12}} | {{#pos: {{{1}}} | ; | {{#expr: {{#var:f12}} + 1 }} }} }}}} |<!--
| |
− | -->{{Grid2/Cell|{{#explode: {{{1}}} | ; | 12 }}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}} }}<!-- 13th frame
| |
− | | |
− | -->{{#if: {{#vardefineecho:f14|{{#if: {{#var:f13}} | {{#pos: {{{1}}} | ; | {{#expr: {{#var:f13}} + 1 }} }} }}}} |<!--
| |
− | -->{{Grid2/Cell|{{#explode: {{{1}}} | ; | 13 }}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}} }}<!-- 14th frame
| |
− | | |
− | -->{{#if: {{#vardefineecho:f15|{{#if: {{#var:f14}} | {{#pos: {{{1}}} | ; | {{#expr: {{#var:f14}} + 1 }} }} }}}} |<!--
| |
− | -->{{Grid2/Cell|{{#explode: {{{1}}} | ; | 14 }}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}} }}<!-- 15th frame
| |
− | | |
− | -->{{#if: {{#vardefineecho:f16|{{#if: {{#var:f15}} | {{#pos: {{{1}}} | ; | {{#expr: {{#var:f15}} + 1 }} }} }}}} |<!--
| |
− | -->{{Grid2/Cell|{{#explode: {{{1}}} | ; | 15 }}|mod={{{mod|}}}|title={{{title|}}}|link={{{link|}}}}} }}<!-- 16th frame
| |
− | | |
− | | |
− | -->{{#if: {{#if: {{#var:f16}} | {{#pos: {{{1}}} | ; | {{#expr: {{#var:f16}} + 1 }} }} }} | [[Category:Too many frames]] }}<!-- More frames than supported
| |
− | --></span><!--
| |
− | | |
− | -->}}<!--
| |
| --></span><!-- | | --></span><!-- |
| --></span><!-- | | --></span><!-- |
Documentation
The grid template is a singular grid cell, which has the ability to display any image (usually a block or item) that is uploaded as Grid <Name>.png, within it.
Usage
All inputs are optional (however Amount, Link and Title won't do anything without Name):
{{Grid2
|Amount
|default=Image always shown under the main image
|align=Vertical Alignment
|link=Link override
|title=Title, removes link
|class=Adds additional classes to the .grid class
}}
Examples
To display this image File:Grid Raw Porkchop.png with an amount of 20 you would put: {{Grid|Raw Porkchop,20}}
- shows
An amount of 2 - 999 is supported, anything else will not be displayed. Note, the automatic link is removed if {{SUBPAGENAME}} is the same as the item name. This is to help prevent self-links, use the link parameter to re-add the link if you need it.
If no image is specified, the background will be added on its own, this could be used to do layouts like so:
{{Grid2|TNT}}{{Grid2|TNT}}{{Grid2}}{{Grid2}}{{Grid2|TNT}}{{Grid2|TNT}}<br>
{{Grid2|TNT}}{{Grid2|TNT}}{{Grid2}}{{Grid2}}{{Grid2|TNT}}{{Grid2|TNT}}<br>
{{Grid2}}{{Grid2}}{{Grid2|TNT}}{{Grid2|TNT}}{{Grid2}}{{Grid2}}<br>
{{Grid2}}{{Grid2|TNT}}{{Grid2|TNT}}{{Grid2|TNT}}{{Grid2|TNT}}{{Grid2}}<br>
{{Grid2}}{{Grid2|TNT}}{{Grid2|TNT}}{{Grid2|TNT}}{{Grid2|TNT}}{{Grid2}}<br>
{{Grid2}}{{Grid2|TNT}}{{Grid2}}{{Grid2}}{{Grid2|TNT}}{{Grid2}}
- shows
Animation is fully supported up to 16 frames, frames are separated by semi-colons (;).
{{Grid2|Soul Dust;;Grass Block,5;Sand}}
- shows
Here is an animation with 16 frames, for debugging purposes:
Other templates
These templates implement this template into a GUI screen which mimics how it would look in Minecraft. Thus, they have mostly the same features as this template.