getTokenOpacity: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Created page with "{{MacroFunction |name=getTokenOpacity |version=1.4.2.0 |description=returns the opacity value of the corresponding token. |usage= <source lang="mtmacro" line> getTokenOpaci...")
 
m (Text replacement - "<source" to "<syntaxhighlight")
 
(9 intermediate revisions by 6 users not shown)
Line 2: Line 2:
|name=getTokenOpacity
|name=getTokenOpacity
|version=1.4.2.0
|version=1.4.2.0
|description=returns the opacity value of the corresponding token.   
|description=
Returns the opacity value of the corresponding token.   


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro">
getTokenOpacity([id])
getTokenOpacity()
</source>
getTokenOpacity(id)
getTokenOpacity(id, mapname)
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
{{param|id|OPTIONAL: The token {{code|id}} of the token for which you want to retrieve the opacity, defaults to the [[Current Token]].
{{param|id|OPTIONAL: The token {{code|id}} of the token for which you want to retrieve the opacity, defaults to the [[Current Token]].}}{{TrustedParameter}}
{{param|mapname|OPTIONAL: The name of the map to find the token.  Defaults to the current map.}}


|example=
|example=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
The opacity for the Dragon token is: [r: getTokenOpacity("Dragon")]
The opacity for the Dragon token is: [r: getTokenOpacity("Dragon")]
[h, token("Dragon"): opacity = getAlwaysVisible()]
[h, token("Dragon"): opacity = getTokenOpacity()]
</source>
</syntaxhighlight>
|changes={{change|1.5.4|Added {{code|mapname}} parameter option.}}
}}
}}
[[Category:VBL Function]]
[[Category:Token Function]]

Latest revision as of 21:10, 14 March 2023

getTokenOpacity() Function

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

Usage

getTokenOpacity()
getTokenOpacity(id)
getTokenOpacity(id, mapname)

Parameters

  • id - OPTIONAL: The token id of the token for which you want to retrieve the opacity, defaults to the Current Token.

     Note: This parameter can only be used in a Trusted Macro

  • mapname - OPTIONAL: The name of the map to find the token. Defaults to the current map.

Example

The opacity for the Dragon token is: [r: getTokenOpacity("Dragon")]
[h, token("Dragon"): opacity = getTokenOpacity()]


Version Changes

  • 1.5.4 - Added mapname parameter option.