Template:BlockGrid/doc

From MC Public Wiki
Jump to navigation Jump to search

{{#vardefine: nodoc | {{{nodoc}}} }}{{#vardefine: baddoc | {{{baddoc}}} }}

Template-info.png Documentation

This Template is used to draw simple 2D-Blockgraphics.

It uses the terms from BlockSprite to define single-character-abbrevations for blocks, which can be used in a Table-like fashion

Example

{{BlockGrid
|g=grass|s=stone|S=sand| =air
|s g
|gSa
}}
produces
{{#fornumargs: rownum | tablerow | {{#loop: column | 0 | {{#len:{{#var:tablerow}}}} | {{#vardefine:blockid|{{{ {{#sub:{{#var:tablerow}}|{{#var:column}}|1}} }}}}} }} }}
BlockCSS.png
Note that undefined prefixes or prefixes assigned to block names unknown to the BlockSprite template are replaced by
BlockCSS.png
.

Also, the space character (“ ”) can be used as key, but will be removed at the beginning and end of rows.

This is the documentation page, it should be transcluded into the main template page. See Template:Doc for more information.