Actions

Template

Difference between revisions of "GetTile"

From Sonic Retro

 
(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
Unfortunately it's a bit too slow to be of any use. Oh well -[[User:Black Squirrel|Black Squirrel]] ([[User talk:Black Squirrel|talk]]) 08:24, 8 January 2021 (EST)
+
| image=Sonic1 MD Map SLZ chunks.png
[[Category:Sonic Retro templates]]</noinclude>
+
| 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
}}
4


Sonic1 MD Map MZ chunks.png
{{GetTile
| image=Sonic1 MD Map MZ chunks.png
| tilesize=256
| id=13
}}
19


Sonic1 MD Map MZ chunks.png
{{GetTile
| image=Sonic1 MD Map MZ chunks.png
| tilesize=256
| id=32
}}
50


Sonic1 MD Map MZ chunks.png
{{GetTile
| image=Sonic1 MD Map SLZ chunks.png
| tilesize=256
| id=38
}}
56


Sonic1 MD Map SLZ chunks.png