Difference between revisions of "Template:3dblock"

From StarMade Wiki
m
m
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#switch:{{{1}}}  <!-- add a parameters for after use, as they was making rewrite all code for it further -->
+
{{#switch:{{{2}}}  <!-- add a parameters for after use, as they was making rewrite all code for it further ::  $1 name, $2 format, 3$ free -->
|0=<div class="wrapcube">
+
|0=<div class="wrapcube"><!--
<div class="cube3d">
+
                                --><div class="cube3d"><!--
<div class="cubefront" ><div><div style="margin-left: {{#expr: -70*({{{2}}}-((trunc({{{2}}}/16))*16))}}px;">[[file:b{{#expr: (trunc({{{2}}}/16))*16}}.png|x70px]]</div></div></div>
+
                                                            --><div class="cubefront" style="overflow:hidden;"><div style="margin-left: {{#expr: -90*({{{4}}}-((trunc({{{4}}}/16))*16))-7}}px; margin-top:-7px;">[[file:b{{#expr: (trunc({{{4}}}/16))*16}}.png|x90px|link={{Db|{{{1}}}|link}}]]</div></div><!--
<div class="cubeback"><div><div style="margin-left: {{#expr: -70*({{{3}}}-((trunc({{{3}}}/16))*16))}}px;">[[file:b{{#expr: (trunc({{{3}}}/16))*16}}.png|x70px]]</div></div></div>
+
                                                            --><div class="cubeback" style="overflow:hidden;"><div style="margin-left: {{#expr: -90*({{{5}}}-((trunc({{{5}}}/16))*16))-7}}px; margin-top:-7px;">[[file:b{{#expr: (trunc({{{5}}}/16))*16}}.png|x90px|link={{Db|{{{1}}}|link}}]]</div></div><!--
<div class="cubetop" ><div><div style=" margin-left: {{#expr: -70*({{{4}}}-((trunc({{{4}}}/16))*16))}}px;">[[file:b{{#expr: (trunc({{{4}}}/16))*16}}.png|x70px]]</div></div></div>
+
                                                            --><div class="cubetop" style="overflow:hidden;" ><div style=" margin-left: {{#expr: -90*({{{6}}}-((trunc({{{6}}}/16))*16))-7}}px; margin-top:-7px;">[[file:b{{#expr: (trunc({{{6}}}/16))*16}}.png|x90px|link={{Db|{{{1}}}|link}}]]</div></div><!--
<div class="cubebottom"><div><div style=" margin-left: {{#expr: -70*({{{5}}}-((trunc({{{5}}}/16))*16))}}px;">[[file:b{{#expr: (trunc({{{5}}}/16))*16}}.png|x70px]]</div></div></div>
+
                                                            --><div class="cubebottom" style="overflow:hidden;"><div style=" margin-left: {{#expr: -90*({{{7}}}-((trunc({{{7}}}/16))*16))-7}}px; margin-top:-7px;">[[file:b{{#expr: (trunc({{{7}}}/16))*16}}.png|x90px|link={{Db|{{{1}}}|link}}]]</div></div>
<div class="cubeleft"><div><div style=" margin-left: {{#expr: -70*({{{6}}}-((trunc({{{6}}}/16))*16))}}px;">[[file:b{{#expr: (trunc({{{6}}}/16))*16}}.png|x70px]]</div></div></div>
+
{{#switch:{{Db|{{{1}}}|BlockStyle}}|
<div class="cuberight"><div><div style=" margin-left: {{#expr: -70*({{{7}}}-((trunc({{{7}}}/16))*16))}}px;">[[file:b{{#expr: (trunc({{{7}}}/16))*16}}.png|x70px]]</div></div></div>
+
|0=<div class="cubeleft" style="overflow:hidden;"><div style=" margin-left: {{#expr: -90*({{{8}}}-((trunc({{{8}}}/16))*16))-7}}px; margin-top:-7px;">[[file:b{{#expr: (trunc({{{8}}}/16))*16}}.png|x90px|link={{Db|{{{1}}}|link}}]]</div></div><!--
</div>
+
                                                            --><div class="cuberight" style="overflow:hidden;"><div style=" margin-left: {{#expr: -90*({{{9}}}-((trunc({{{9}}}/16))*16))-7}}px; margin-top:-7px; ">[[file:b{{#expr: (trunc({{{9}}}/16))*16}}.png|x90px|link={{Db|{{{1}}}|link}}]]</div></div>
</div>
+
|6=<div class="cubeleft6" style="overflow:hidden;"><div style=" margin-left: {{#expr: -90*({{{8}}}-((trunc({{{8}}}/16))*16))-7}}px; margin-top:-7px;">[[file:b{{#expr: (trunc({{{8}}}/16))*16}}.png|x90px|link={{Db|{{{1}}}|link}}]]</div></div><!--
 +
                                                            --><div class="cuberight6" style="overflow:hidden;"><div style=" margin-left: {{#expr: -90*({{{9}}}-((trunc({{{9}}}/16))*16))-7}}px; margin-top:-7px;">[[file:b{{#expr: (trunc({{{9}}}/16))*16}}.png|x90px|link={{Db|{{{1}}}|link}}]]</div></div>}} <!--
 +
                                                            --></div>  
 +
                          </div>
 
|1=not used yet
 
|1=not used yet
}}
+
}}<!--
 +
--><noinclude>{{Documentation}}</noinclude>

Latest revision as of 03:42, 17 May 2018

[view] [edit] [history] [[[:Template:Purge]]] 50px Template documentation

Table requested by textureId from Sub database.

This parameter store adresses of side textures of each blocks.

this template format it using CSS to make a simple cube rotating.

The 3 game files (T0000.png, t0001.png, T0002.png) from Starmade/data/textures/block/default/128 are all divised in 16 lines of 16 textures and request by adresses. Image Names on wiki are : b0.png, b16.png, b32.png, b48.png, b64.png, b80.png, .... ,b512.png, b528.png, b544.png ... etc....