Template:Tile: Difference between revisions

From DDraceNetwork
Select tiles from any layer
 
Move explanation of template to Template page
Line 1: Line 1:
<span class="display-tile {{{1}}}" style="background-position: -{{#expr: ( {{{2}}} mod 16) * 32}}px -{{#expr: (floor({{{2}}} div 16)) * 32}}px;"></span>
<noinclude>
Usage: <code><nowiki>{{Tile|layer|index}}</nowiki></code>. No image is displayed if the layer name is misspelled or no tile exists at that index on the layer. Use [httpsː//ddnet.tw/explain] to determine indices of tiles.
 
== Examples ==
 
{| class="wikitable"
|+ Caption text
|-
! Layer !! code !! preview
|-
| entities || <code><nowiki>{{Tile|entities|1}}</nowiki></code> || {{Tile|entities|1}}
|-
| game || <code><nowiki>{{Tile|game|3}}</nowiki></code> || {{Tile|game|3}}
|-
| front || <code><nowiki>{{Tile|front|66}}</nowiki></code> || {{Tile|front|66}}
|-
| tele || <code><nowiki>{{Tile|tele|26}}</nowiki></code> || {{Tile|tele|26}}
|-
| speedup || <code><nowiki>{{Tile|speedup|28}}</nowiki></code> || {{Tile|speedup|28}}
|-
| switch || <code><nowiki>{{Tile|switch|22}}</nowiki></code> || {{Tile|switch|22}}
|-
| tune || <code><nowiki>{{Tile|tune|68}}</nowiki></code> || {{Tile|tune|68}}
|}
</noinclude>
<includeonly><span class="display-tile {{{1}}}" style="background-position: -{{#expr: ( {{{2}}} mod 16) * 32}}px -{{#expr: (floor({{{2}}} div 16)) * 32}}px;"></span></includeonly>

Revision as of 17:44, 5 March 2022

Usage: {{Tile|layer|index}}. No image is displayed if the layer name is misspelled or no tile exists at that index on the layer. Use [httpsː//ddnet.tw/explain] to determine indices of tiles.

Examples

Caption text
Layer code preview
entities {{Tile|entities|1}}

game {{Tile|game|3}}

front {{Tile|front|66}}

tele {{Tile|tele|26}}

speedup {{Tile|speedup|28}}

switch {{Tile|switch|22}}

tune {{Tile|tune|68}}