Difference between revisions of "GetTile"
From Sonic Retro
BSonirachi (talk | contribs) m (Text replacement - "Category:Sonic Retro templates" to "Category:Templates") |
|||
(One intermediate revision by one other user not shown) | |||
Line 2: | Line 2: | ||
{{#vardefine:x|0}}{{#vardefine:y|0}}{{#vardefine:n|{{#expr:{{#var:hexid}}*{{{tilesize}}}}}}} | {{#vardefine:x|0}}{{#vardefine:y|0}}{{#vardefine:n|{{#expr:{{#var:hexid}}*{{{tilesize}}}}}}} | ||
{{#while: | {{#while: | ||
− | |{{#ifexpr:{{#var:n}} > {{#var:imagewidth}}|true}} | + | |{{#ifexpr:{{#var:n}} >= {{#var:imagewidth}}|true}} |
|{{#vardefine:n|{{#expr:{{#var:n}}-{{#var:imagewidth}}}}}}{{#vardefine:y|{{#expr:{{#var:y}} + {{{tilesize}}}}}}} | |{{#vardefine:n|{{#expr:{{#var:n}}-{{#var:imagewidth}}}}}}{{#vardefine:y|{{#expr:{{#var:y}} + {{{tilesize}}}}}}} | ||
}} | }} | ||
Line 42: | Line 42: | ||
| id=32 | | id=32 | ||
}} | }} | ||
− | + | <pre>{{GetTile | |
− | + | | image=Sonic1 MD Map SLZ chunks.png | |
− | [[Category: | + | | tilesize=256 |
+ | | id=38 | ||
+ | }}</pre> | ||
+ | {{GetTile | ||
+ | | image=Sonic1 MD Map SLZ chunks.png | ||
+ | | tilesize=256 | ||
+ | | id=38 | ||
+ | }} | ||
+ | [[Category:Templates]]</noinclude> |
Latest revision as of 19:20, 1 January 2022
Get the a tile in a tileset with a supplied hexadecimal number:
{{GetTile | image=Sonic1 MD Map MZ chunks.png | tilesize=256 | id=4 }}
{{GetTile | image=Sonic1 MD Map MZ chunks.png | tilesize=256 | id=13 }}
{{GetTile | image=Sonic1 MD Map MZ chunks.png | tilesize=256 | id=32 }}
{{GetTile | image=Sonic1 MD Map SLZ chunks.png | tilesize=256 | id=38 }}