User:NtCarlson/Template:Damage dice image: Difference between revisions
Jump to navigation
Jump to search
(Made size of element correctly adjust with dice size) |
(Updated documentation) |
||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
Width specifies the size of the dice rather than the size of the entire element | Width specifies the size of the dice rather than the size of the entire element | ||
-->{{#lvardef: width | {{{width| | -->{{#lvardef: width | {{{width|30px}}}}}<!-- | ||
Get the number of dice needed to compute the size of the element | Get the number of dice needed to compute the size of the element | ||
-->{{#lvardef: n_dice | 0}}{{#while: | -->{{#lvardef: n_dice | 0}}{{#while: | ||
Line 42: | Line 42: | ||
}}}} | }}}} | ||
<span style=" | <span style=" | ||
z-index: -{{#lvar: i}}; | z-index: {{#expr: {{#lvar: n_dice}} - {{#lvar: i}}}}; | ||
position: absolute; | position: absolute; | ||
transform: {{#lvar: transform}} | transform: {{#lvar: transform}} | ||
Line 48: | Line 48: | ||
{{#lvardef: i | {{#expr: {{#lvar: i }} + 1 }} }} | {{#lvardef: i | {{#expr: {{#lvar: i }} + 1 }} }} | ||
}}</span></includeonly><noinclude> | }}</span></includeonly><noinclude> | ||
{{User:NtCarlson/Template:Damage dice image| | [[File:Damage_dice_reference_image.png|thumb|right|Example of an in-game tooltip displaying damage dice.]] | ||
{{User:NtCarlson/Template:Damage dice image|width= | Replicates the damage dice display used in game. | ||
{{clear}} | |||
== Examples == | |||
{{Template demo | |||
| style = table | |||
| <nowiki> | |||
{{User:NtCarlson/Template:Damage dice image|d12:Physical|d4:Fire}} | |||
</nowiki> | |||
| <nowiki> | |||
{{User:NtCarlson/Template:Damage dice image | |||
| width = 60px | |||
| d8:Physical | |||
| d4:Fire | |||
| d4:Psychic | |||
| d4:Psychic | |||
| d8:Radiant | |||
}} | |||
</nowiki> | |||
}} | |||
</noinclude> | </noinclude> |