setTokenImage: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 9: Line 9:
setTokenImage(assetId)
setTokenImage(assetId)
setTokenImage(assetId, id)
setTokenImage(assetId, id)
setTokenImage(assetId, id, mapname)
setTokenImage(assetId, id, mapRef)
</syntaxhighlight>
</syntaxhighlight>
<syntaxhighlight lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
setTokenImage(imageToken)
setTokenImage(imageToken)
setTokenImage(imageToken, id)
setTokenImage(imageToken, id)
setTokenImage(imageToken, id, mapname)
setTokenImage(imageToken, id, mapRef)
</syntaxhighlight>
</syntaxhighlight>
'''Parameters'''
'''Parameters'''
Line 20: Line 20:
{{param|imageToken|The name of an image token e.g. "image:myimage"}}
{{param|imageToken|The name of an image token e.g. "image:myimage"}}
{{param|id|OPTIONAL: The token {{code|id}} of the token for which you want to set the image, defaults to the [[Current Token]]. }}
{{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.}}
{{param|mapRef|OPTIONAL: The Name or ID of the map to find the token.  Defaults to the current map.}}


|example=
|example=

Latest revision as of 23:59, 14 March 2023

setTokenImage() Function

Introduced in version 1.3b48
Sets the image for the for the Current Token. The function accepts an Asset ID or an Image Token name. You can get Asset IDs from macro functions such as tblImage() or getTokenImage(). Image Tokens are special tokens whose name starts with "image:".

Usage

setTokenImage(assetId)
setTokenImage(assetId, id)
setTokenImage(assetId, id, mapRef)
setTokenImage(imageToken)
setTokenImage(imageToken, id)
setTokenImage(imageToken, id, mapRef)

Parameters

  • assetId - The Asset ID for an image.
  • imageToken - The name of an image token e.g. "image:myimage"
  • id - OPTIONAL: The token id of the token for which you want to set the image, defaults to the Current Token.
  • mapRef - OPTIONAL: The Name or ID 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.