Template:Ability icon: Difference between revisions
v435 update |
mNo edit summary |
||
| Line 1: | Line 1: | ||
<noinclude><!-- Updated on Mon Sep 15 2025 09:08:15 GMT-0600 (Mountain Daylight Time) using FoxnEagle's auto-wiki-generator --> | <noinclude><!-- Updated on Mon Sep 15 2025 09:08:15 GMT-0600 (Mountain Daylight Time) using FoxnEagle's auto-wiki-generator --> | ||
</noinclude><includeonly>{{ #switch: {{{2}}} | 1 | 32 = <span class="extimage32px">| 2 | 64 = <span class="extimage64px"> | }}{{ #if: {{{1|}}} | | </noinclude><includeonly>{{ #switch: {{{2}}} | 1 | 32 = <span class="extimage32px">| 2 | 64 = <span class="extimage64px"> | }}{{ #if: {{{1|}}} | | ||
{{ #replace: http://cdn.projectgorgon.com/ | {{ #replace: http://cdn.projectgorgon.com/v445/icons/icon_{{ #switch: {{padleft: | 1 | {{ lc: {{{1}}} }} }} | ||
| a = {{ #switch: {{{1}}} | | a = {{ #switch: {{{1}}} | ||
| Acid Arrow (Orc) = 3302 | | Acid Arrow (Orc) = 3302 | ||
| Line 3,934: | Line 3,934: | ||
}} | }} | ||
}}.png | }}.png | ||
| http://cdn.projectgorgon.com/ | | http://cdn.projectgorgon.com/v445/icons/icon_.png <!-- result when no match is found, will be #replaced --> | ||
| <span style="color:red">Error: Ability not found</span> }} | [[File:Item-icon-none.png]] }}{{ #switch: {{{2}}} | 1 | 2 | 32 | 64 = </span> | }}</includeonly><noinclude> | | <span style="color:red">Error: Ability not found</span> }} | [[File:Item-icon-none.png]] }}{{ #switch: {{{2}}} | 1 | 2 | 32 | 64 = </span> | }}</includeonly><noinclude> | ||
{{Documentation}} | {{Documentation}} | ||
[[Category:Formatting templates]] | [[Category:Formatting templates]] | ||
</noinclude> | </noinclude> | ||
Revision as of 22:41, 15 January 2026
Description
This accepts an ability name as input and returns the in-game icon. Most of these are 64x64, but you can resize them if needed. See the Examples section below.
Syntax
{{Ability icon|<name>|<size selection>}}
Parameters
- <name>
- The name of the ability. It must match exactly what is displayed in-game (e.g. "Super Fireball", not "SUPER fireball" or "Fireball")
- If omitted or empty, template returns a blank icon image.
- If no match is found, template returns an error.
- <size selection>
- 1 or 32 for 32x32.
- 2 or 64 for 64x64.
- If omitted, empty, or anything else, image isn't resized.
Examples
Standard Use
{{Ability icon|Ring of Fire}}
{{Ability icon}}
{{Ability icon|FakeAbilityReturnsError}}
{{ #replace: http://cdn.projectgorgon.com/v445/icons/icon_2120.png | http://cdn.projectgorgon.com/v445/icons/icon_.png | Error: Ability not found }}
{{ #replace: http://cdn.projectgorgon.com/v445/icons/icon_.png | http://cdn.projectgorgon.com/v445/icons/icon_.png | Error: Ability not found }}
Resizing
{{Ability icon|Ring of Fire}} <!-- default size is 64x64 -->
{{Ability icon|Ring of Fire|64}}
{{Ability icon|Ring of Fire|32}}
{{ #replace: http://cdn.projectgorgon.com/v445/icons/icon_2120.png | http://cdn.projectgorgon.com/v445/icons/icon_.png | Error: Ability not found }}
{{ #replace: http://cdn.projectgorgon.com/v445/icons/icon_2120.png | http://cdn.projectgorgon.com/v445/icons/icon_.png | Error: Ability not found }}
{{ #replace: http://cdn.projectgorgon.com/v445/icons/icon_2120.png | http://cdn.projectgorgon.com/v445/icons/icon_.png | Error: Ability not found }}
Alternative Resizing (old method)
You can also manually resize the images if you wish (using the template just wraps the image in this span automatically).
<span class="extimage32px">{{Ability icon|Ring of Fire}}</span>
<span class="extimage64px">{{Ability icon|Ring of Fire}}</span>
{{ #replace: http://cdn.projectgorgon.com/v445/icons/icon_2120.png | http://cdn.projectgorgon.com/v445/icons/icon_.png | Error: Ability not found }}
{{ #replace: http://cdn.projectgorgon.com/v445/icons/icon_2120.png | http://cdn.projectgorgon.com/v445/icons/icon_.png
| Error: Ability not found }}If you're done making changes, please refresh the text.
Please add categories and interwikis to Template:Ability icon/doc. (View all subpages of this page.)