setTokenOpacity: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page SetTokenOpacity to setTokenOpacity: Converting page titles to lowercase)
No edit summary
Line 5: Line 5:


|usage=
|usage=
<source lang="mtmacro">
<syntaxhighlight lang="mtmacro">
setTokenOpacity(value)
setTokenOpacity(value)
setTokenOpacity(value, id)
setTokenOpacity(value, id)
setTokenOpacity(value, id, mapname)
setTokenOpacity(value, id, mapname)
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
Line 19: Line 19:


|example=
|example=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: setTokenOpacity(0.5, "Dragon")]
[h: setTokenOpacity(0.5, "Dragon")]
[h, token("Dragon"): setTokenOpacity(0.75)]
[h, token("Dragon"): setTokenOpacity(0.75)]
</source>
</syntaxhighlight>


|changes={{change|1.5.4|Added {{code|mapname}} parameter option.}}
|changes={{change|1.5.4|Added {{code|mapname}} parameter option.}}
}}
}}
[[Category:VBL Function]]
[[Category:VBL Function]]

Revision as of 20:28, 14 March 2023

setTokenOpacity() Function

Introduced in version 1.4.2.0
Sets the opacity value of the corresponding token.

Usage

setTokenOpacity(value)
setTokenOpacity(value, id)
setTokenOpacity(value, id, mapname)

Parameters

  • value - The value of the opacity to set, ranging from 0.0 (completely transparent) to 1.0 (completely opaque). This must be a floating point value with leading zero if less than 1.0.
  • id - OPTIONAL: The token id of the token for which you want to retrieve the opacity, defaults to the Current Token.
  • mapname - OPTIONAL: The name of the map to find the token. Defaults to the current map.

Returns The opacity value that was set.

Example

[h: setTokenOpacity(0.5, "Dragon")]
[h, token("Dragon"): setTokenOpacity(0.75)]


Version Changes

  • 1.5.4 - Added mapname parameter option.