Difference between revisions of "Template:StatsHex"

From Cassette Beasts
(Created page with "<div style="width: 300px;"><onlyinclude><!-- stats-hex container --><div style="position: relative; box-sizing: border-box; width: 100%; height: 100%; padding: calc(2lh + 0.25...")
 
m (Re-size demonstration table to 100% width, as the hex would otherwise have a size of 0×0)
 
Line 7: Line 7:
 
'''IMPORTANT NOTE:''' The stat hexagon will ''always'' scale to the surrounding element's bounds! This means that, unless you put the result of this template into a width- and/or height-constrained element, the hexagon will use the entire width available in its parent element.
 
'''IMPORTANT NOTE:''' The stat hexagon will ''always'' scale to the surrounding element's bounds! This means that, unless you put the result of this template into a width- and/or height-constrained element, the hexagon will use the entire width available in its parent element.
  
<table class="wikitable mw-collapsible mw-collapsed">
+
<table class="wikitable mw-collapsible mw-collapsed" style="width: 100%">
 
<tr>
 
<tr>
 
<th colspan="2">Automatic scaling demonstration</th>
 
<th colspan="2">Automatic scaling demonstration</th>

Latest revision as of 15:30, 30 November 2024

Max HP
50
M. Atk
50
M. Def
50
Speed
50
R. Def
50
R. Atk
50

IMPORTANT NOTE: The stat hexagon will always scale to the surrounding element's bounds! This means that, unless you put the result of this template into a width- and/or height-constrained element, the hexagon will use the entire width available in its parent element.

Automatic scaling demonstration
constrained to a width of 300px unconstrained
Max HP
50
M. Atk
50
M. Def
50
Speed
50
R. Def
50
R. Atk
50
Max HP
50
M. Atk
50
M. Def
50
Speed
50
R. Def
50
R. Atk
50

In order to achieve the same size as the example at the beginning of the page, use the template as follows:

 <div style="width: 300px;">{{StatsHex}}</div> 

Parameters

maxhp
(optional, defaults to 50)
Value of the "Max HP" stat.
matk
(optional, defaults to 50)
Value of the "M. Atk" stat.
mdef
(optional, defaults to 50)
Value of the "M. Def" stat.
ratk
(optional, defaults to 50)
Value of the "R. Def" stat.
rdef
(optional, defaults to 50)
Value of the "R. Atk" stat.
speed
(optional, defaults to 50)
Value of the "Speed" stat.
max
(optional, defaults to 300)
Maximum value that can be shown in the stats hexagon. The higher the value, the lower the scaling factor for all stats. Should not be lower than any stat's value or things might start to look... odd.

Examples

  • <div style="width: 300px;">{{StatsHex|maxhp=144|matk=100|mdef=100|ratk=100|rdef=100|speed=100|max=150}}</div>
    
    Max HP
    144
    M. Atk
    100
    M. Def
    100
    Speed
    100
    R. Def
    100
    R. Atk
    100
  • <div style="width: 300px;">{{StatsHex|maxhp=80|matk=150|mdef=80|ratk=80|rdef=80|speed=190}}</div>
    
    Max HP
    80
    M. Atk
    150
    M. Def
    80
    Speed
    190
    R. Def
    80
    R. Atk
    80