setTokenPortrait: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: {{MacroFunction |name=setTokenPortrait |version=1.3b77 |description= Sets the portrait image for the for the Current Token. The image can come from several sources. It can be an [[as...)
 
No edit summary
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{MacroFunction
{{MacroFunction
|name=setTokenPortrait
|name=setTokenPortrait
|version=1.3b77
|version=1.3b77
|description=
|description=
Sets the portrait image for the for the [[Current Token]]. The image can come from several sources. It can be an [[asset id]] (like from [[Macros:Functions:tblImage |tblImage()]] or[[Macros:Functions:getTokenImage|getTokenImage()]].) or a [[Token:Image Token|Image Token]].
Sets the portrait image for the for the [[Current Token]]. The image can come from several sources. It can be an [[Asset ID]] (like from [[Macros:Functions:tblImage |tblImage()]] or [[Macros:Functions:getTokenImage|getTokenImage()]]), or a [[Image Token]].


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
setTokenPortrait(assetId)
setTokenPortrait(assetId)
</source>
setTokenPortrait(assetId, id)
<source lang="mtmacro" line>
setTokenPortrait(assetId, id, mapname)
</syntaxhighlight>
<syntaxhighlight lang="mtmacro" line>
setTokenPortrait(tokenImageName)
setTokenPortrait(tokenImageName)
</source>
setTokenPortrait(tokenImageName, id)
setTokenPortrait(tokenImageName, id, mapname)
</syntaxhighlight>


'''Parameters'''
{{param|id|OPTIONAL: The token {{code|id}} of the token for which you want to set the portrait, defaults to the [[Current Token]]. }}
{{param|mapname|OPTIONAL: The name of the map to find the token.  Defaults to the current map.}}
|changes={{change|1.5.4|Added {{code|mapname}} parameter option.}}
}}
}}


[[Category:Token Function]]
[[Category:Token Function]]

Latest revision as of 01:48, 21 April 2023

setTokenPortrait() Function

Introduced in version 1.3b77
Sets the portrait image for the for the Current Token. The image can come from several sources. It can be an Asset ID (like from tblImage() or getTokenImage()), or a Image Token.

Usage

setTokenPortrait(assetId)
setTokenPortrait(assetId, id)
setTokenPortrait(assetId, id, mapname)
setTokenPortrait(tokenImageName)
setTokenPortrait(tokenImageName, id)
setTokenPortrait(tokenImageName, id, mapname)

Parameters

  • id - OPTIONAL: The token id of the token for which you want to set the portrait, defaults to the Current Token.
  • mapname - OPTIONAL: The name of the map to find the token. Defaults to the current map.


Version Changes

  • 1.5.4 - Added mapname parameter option.