getImage: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
m (Tweaking page layout and typography)
Line 6: Line 6:
|usage=
|usage=
{{Clarify|There's no real parameter description.<br />
{{Clarify|There's no real parameter description.<br />
Error handling on duplicates should be pointed out.<br />
Error handling on duplicates should be pointed out.}}
Token ID does NOT work, only token.name works}}
<source lang="mtmacro" line>
<source lang="mtmacro" line>
getImage(name)
getImage(name)
</source>
</source>
'''Note:''' Token ID does NOT work, only token name works.


Note that token images can be retrieved from ANY map (so they do NOT have to be on the current map).  If identical token names appear on multiple maps, it may be difficult (or impossible) to select a specific token image using this function.
Note that token images can be retrieved from ANY map (so they do NOT have to be on the current map).  If identical token names appear on multiple maps, it may be difficult (or impossible) to select a specific token image using this function.

Revision as of 10:45, 7 April 2013

getImage() Function

Introduced in version 1.3b48
Returns the asset id for the image of a Token or Image Token.

Usage

Needs Clarification:
There's no real parameter description.
Error handling on duplicates should be pointed out.

getImage(name)

Note: Token ID does NOT work, only token name works.

Note that token images can be retrieved from ANY map (so they do NOT have to be on the current map). If identical token names appear on multiple maps, it may be difficult (or impossible) to select a specific token image using this function.

Example

To display the image from an image token called image:Map you can do the following:
<img src="[r: getImage('image:Map')]"></img>

Alternatively this can be used to retrieve a normal token:

<img src="[r: getImage('Dragon')]"></img>

See Also

getTokenImage (which you can give the size as parameter)