getStateImage: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page GetStateImage to getStateImage: Converting page titles to lowercase)
m (Text replacement - "<source" to "<syntaxhighlight")
Line 7: Line 7:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
getStateImage(state)
getStateImage(state)
</source>
</source>
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
getStateImage(state, size)
getStateImage(state, size)
</source>
</source>
Line 19: Line 19:
|example=
|example=
To display the image for the "Dead" [[Token:state | token state]] use.
To display the image for the "Dead" [[Token:state | token state]] use.
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
<img src='[r:getStateImage("Dead")]'></img>
<img src='[r:getStateImage("Dead")]'></img>
</source>
</source>

Revision as of 20:00, 14 March 2023

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.

getStateImage() Function

Introduced in version 1.3b40
Gets the asset id for the image of a state, the state must be one of the image types for this to work.

Usage

<syntaxhighlight lang="mtmacro" line> getStateImage(state) </source> <syntaxhighlight lang="mtmacro" line> getStateImage(state, size) </source> Parameters

  • state - The name of the state which has its image asset returned.
  • size - The size that the state image will be resized to; this is the height of the final size.

Example

To display the image for the "Dead" token state use.

<syntaxhighlight lang="mtmacro" line> <img src='[r:getStateImage("Dead")]'></img>

</source>