User:NtCarlson/Template:Damage dice image: Difference between revisions

From bg3.wiki
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|40}}}}}<!--
-->{{#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|width=60px|d6:Fire|d4:Radiant|d8:Physical|d12:Lightning|d4:Psychic}} test
[[File:Damage_dice_reference_image.png|thumb|right|Example of an in-game tooltip displaying damage dice.]]
{{User:NtCarlson/Template:Damage dice image|width=30px|d12:Physical|d4:Fire}} test
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>

Revision as of 19:40, 18 December 2024

Example of an in-game tooltip displaying damage dice.

Replicates the damage dice display used in game.

Examples

Markup Renders as
{{User:NtCarlson/Template:Damage dice image|d12:Physical|d4:Fire}}

D12 Physical.pngD4 Fire.png

{{User:NtCarlson/Template:Damage dice image
| width = 60px
| d8:Physical
| d4:Fire
| d4:Psychic
| d4:Psychic
| d8:Radiant
}}

D8 Physical.pngD4 Fire.pngD4 Psychic.pngD4 Psychic.pngD8 Radiant.png