getBarImage: Difference between revisions
Jump to navigation
Jump to search
m (Conversion script moved page GetBarImage to getBarImage: Converting page titles to lowercase) |
m (Text replacement - "source>" to "syntaxhighlight>") |
||
Line 9: | Line 9: | ||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
getBarImage(bar) | getBarImage(bar) | ||
</ | </syntaxhighlight> | ||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
getBarImage(bar, size) | getBarImage(bar, size) | ||
</ | </syntaxhighlight> | ||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
getBarImage(bar, size, value) | getBarImage(bar, size, value) | ||
</ | </syntaxhighlight> | ||
'''Parameters''' | '''Parameters''' | ||
* {{code|state}} - The name of the bar which has its image asset returned. | * {{code|state}} - The name of the bar which has its image asset returned. | ||
Line 25: | Line 25: | ||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
<img src='[r:getBarImage("Mana", 0, 0.5)]'></img> | <img src='[r:getBarImage("Mana", 0, 0.5)]'></img> | ||
</ | </syntaxhighlight> | ||
}} | }} | ||
[[Category:Bar Function]] | [[Category:Bar Function]] |
Revision as of 17:38, 14 March 2023
This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.
getBarImage() Function
• Introduced in version unreleased
Gets the asset id for a specific image in a bar. The bar must be one of the image types (single-, double-, or multi-image) for this to work.
Usage
<source lang="mtmacro" line> getBarImage(bar) </syntaxhighlight> <source lang="mtmacro" line> getBarImage(bar, size) </syntaxhighlight> <source lang="mtmacro" line> getBarImage(bar, size, value) </syntaxhighlight> Parameters
state
- The name of the bar which has its image asset returned.size
- The size that the bar image will be resized to; this is the height of the final size; this argument is optional, pass a 0 or an empty string to ignore it.value
- The value (0 to 1) on the bar where the image asset to be returned is; if a bar only contains a single image, this argument is optional.
Example
To display the image for the midway point of a custom bar called "Mana", use
<source lang="mtmacro" line> <img src='[r:getBarImage("Mana", 0, 0.5)]'></img>
</syntaxhighlight>