setTokenImage: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Fixing wikilink)
No edit summary
Line 8: Line 8:
<source lang="mtmacro" line>
<source lang="mtmacro" line>
setTokenImage(assetId)
setTokenImage(assetId)
setTokenImage(assetId, id)
setTokenImage(assetId, id, mapname)
</source>
</source>
<source lang="mtmacro" line>
<source lang="mtmacro" line>
setTokenImage(tokenImageName)
setTokenImage(tokenImageName)
setTokenImage(tokenImageName, id)
setTokenImage(tokenImageName, id, mapname)
</source>
</source>
{{param|id|OPTIONAL: The token {{code|id}} of the token for which you want to set the image, defaults to the [[Current Token]]. }}
{{param|mapname|OPTIONAL: The name of the map to find the token.  Defaults to the current map.}}


|example=
|example=
Line 18: Line 24:
[h: setTokenImage("image:Elf-Dead")]
[h: setTokenImage("image:Elf-Dead")]
</source>
</source>
|changes={{change|1.5.4|Added {{code|id}} and {{code|mapname}} parameter options.}}
}}
}}
[[Category:Token Function]]
[[Category:Token Function]]

Revision as of 03:55, 15 August 2019

setTokenImage() Function

Introduced in version 1.3b48
Sets the image for the for the Current Token. The image can come from several sources. It can come from a function that returns an asset id such as tblImage() or getTokenImage(). Or it could come from a Image Token.

Usage

setTokenImage(assetId)
setTokenImage(assetId, id)
setTokenImage(assetId, id, mapname)
setTokenImage(tokenImageName)
setTokenImage(tokenImageName, id)
setTokenImage(tokenImageName, id, mapname)
  • id - OPTIONAL: The token id of the token for which you want to set the image, defaults to the Current Token.
  • mapname - OPTIONAL: The name of the map to find the token. Defaults to the current map.

Example

[h: setTokenImage(tblImage("elfImages", 1))]
[h: setTokenImage("image:Elf-Dead")]


Version Changes

  • 1.5.4 - Added id and mapname parameter options.