User:NtCarlson/Template:Damage dice image: Difference between revisions
Jump to navigation
Jump to search
(Prototype of damage dice display that replicates how the game displays it) |
(Parameter parsing) |
||
Line 1: | Line 1: | ||
<includeonly><span style="display: block; width: 60px; height: 60px; padding-left: 40px; padding-top: 40px; position: relative"> | <includeonly>{{#lvardef: i | 1 }}<span style="display: block; width: 60px; height: 60px; padding-left: 40px; padding-top: 40px; position: relative"> | ||
{{#while: | |||
| {{{{{#lvar: i }} |}}} | |||
| | |||
{{#lvardef: die | {{ #explode: {{{{{#lvar: i }} |}}} |:|0}}}} | |||
<span style="z-index:- | {{#lvardef: type | {{ #explode: {{{{{#lvar: i }} |}}} |:|1}}}} | ||
{{#lvardef: pos | {{ #switch: {{#lvar: i }} | |||
| 1 = translate(0px, 0px) | |||
| 2 = translate(40px, -20px) rotate(20deg) | |||
| 3 = translate(-30px, -15px) rotate(40deg) | |||
| 4 = translate(30px, -40px) rotate(25deg) | |||
| 5 = translate(-28px, -42px) rotate(45deg) | |||
}}}} | |||
<span style="z-index: -{{#lvar: i}}; position: absolute; transform: {{#lvar: pos}}">[[File:{{#lvar: die}} {{#lvar:type}}.png]]</span> | |||
{{#lvardef: i | {{#expr: {{#lvar: i }} + 1 }} }} | |||
}} | |||
</span></includeonly><noinclude> | </span></includeonly><noinclude> | ||
{{User:NtCarlson/Template:Damage dice image}} test | {{User:NtCarlson/Template:Damage dice image|d6:Fire|d4:Radiant|d8:Physical|d12:Lightning}} test | ||
</noinclude> | </noinclude> |