Template:Health: Difference between revisions
imported>Ttv pedro270707 (Redirected page to Template:Healthbar) |
imported>Ttv pedro270707 m (Removed redirect to Template:Healthbar) |
||
| Line 1: | Line 1: | ||
# | <includeonly>{{#ifeq: {{bl|{{{notag|}}}}} | y | | {{{1|}}} ( }}{{#ifexpr: {{{1|}}} <= 5 | {{healthbar|size={{{size|9}}}|value={{{1|}}}}} | {{healthbar|size={{{size|9}}}|value=2}} × {{#expr: {{{1|}}} / 2}}}}{{#ifeq: {{bl|{{{notag|}}}}} | y | | ) }}</includeonly><noinclude> | ||
{{Documentation}} | |||
<!-- Put categories on the documentation page --> | |||
</noinclude> | |||
Revision as of 20:43, 25 March 2023
[view | | | ]Documentation
This template displays health points and visualizes these with the help of a health bar.
For a more compact display, all health point values above 10 (5 hearts) are replaced by × [hp / 2].
All health point values which are not whole numbers are also replaced by × [hp / 2].
| Parameter | Function | Default value |
|---|---|---|
1 |
Amount of hearts to show. | 0 |
2 |
Size of hearts in pixels. | 9 |
notag |
Remove number and parenthesis. | None |
total |
Total or minimum amount of hearts to show, any more than the set amount in Template:P are shown as empty. | 0 |
| Code | Result |
|---|---|
{{hp}} |
(Expression error: Unexpected <= operator.) |
{{hp|0}} |
0 (♥) |
{{hp|4}} |
4 ( |
{{hp|4|total=20}} |
4 ( |
{{hp|4|18px}} |
4 ( |
{{hp|20|notag=1}} |
|
{{hp|26|notag=1}} |
|
{{hp|10}} |
10 ( |
{{hp|2.5}} |
2.5 ( |
{{hp|41}} |
41 ( |
[view | | | ]The above documentation is transcluded from Template:Health/doc.