Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Template documentation (for the above template, sometimes hidden or invisible) [view] [edit] [history] [refresh]

Template:Documentation header Template:Lua This template creates a bar made of icons.

{{iconbar
|value=
|title=
|size=
|full=
|half=
|empty=
|reverse=
|total=
|offset=
}}
Parameter Function Default value
value Integer value between 0 and 20. One "full" icon is shown for each increase of 2 to value (e.g. three are shown if value is 6 or 7, etc.), and if value is odd, a "half" icon is shown at the end of the bar. 0
title Mouseover text. If this parameter isn't specified, it falls back to value. None
size Width of each icon in CSS units like "px" or "em". Units default to "px". None
full "Full" icon. One of these is shown for each increase of 2 to value (e.g. three are shown if value is 6 or 7, etc.). None
half "Half" icon, used at the end of the bar if value is odd. None
empty "Empty" icon, used if value is 0 or if total is used and is higher than value. None
reverse Pass a value to display the "half" icon on the left end of the bar instead of the right. None
total Minimum number of icons to be shown. If value is lower than this, empty icons are shown to reach the minimum. None
offset Offset between the icons. Negative values will overlap the icons. -(size/9)

Examples

  • 4/10 HP
    {{iconbar|value=4|title=|size=|full=Heart.svg|half=Half Heart.svg|empty=Empty Heart.svg|reverse=|total=10}}
Template:Iconbar
  • 4/10 HP large
    {{iconbar|value=4|title=|size=18px|full=Heart.svg|half=Half Heart.svg|empty=Empty Heart.svg|reverse=|total=10}}
Template:Iconbar
  • 5/10 HP with title
    {{iconbar|value=5|title=Lorem ipsum|size=|full=Heart.svg|half=Half Heart.svg|empty=Empty Heart.svg|reverse=|total=10}}
Template:Iconbar
  • 5/10 HP mob reversed with title
    {{iconbar|value=5|title=Lorem ipsum|size=|full=Mob Heart.svg|half=Mob Half Heart.svg|empty=Empty Heart.svg|reverse=yess|total=10}}
Template:Iconbar
  • 4/10 HP large with offset between them
    {{iconbar|value=4|title=|size=18px|full=Heart.svg|half=Half Heart.svg|empty=Empty Heart.svg|reverse=|total=10|offset=5px}}
Template:Iconbar

See also

Template:Iconbar see also

es:Plantilla:Barra de icono fr:Modèle:Barre ko:틀:Iconbar pt:Predefinição:Barra de ícone ru:Шаблон:Иконки th:แม่แบบ:Iconbar

zh:Template:Iconbar
The above text is transcluded from Template:MC/Iconbar/doc; you can change it or view its history.
If you're done making changes, please refresh the text.
Please add categories and interwikis to Template:MC/Iconbar/doc. (View all subpages of this page.)