getTokenOpacity: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Text replacement - "<source" to "<syntaxhighlight")
No edit summary
Line 8: Line 8:
<syntaxhighlight lang="mtmacro">
<syntaxhighlight lang="mtmacro">
getTokenOpacity()
getTokenOpacity()
getTokenOpacity(id)
getTokenOpacity(tokenRef)
getTokenOpacity(id, mapname)
getTokenOpacity(tokenRef, mapname)
</syntaxhighlight>
</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]].}}{{TrustedParameter}}
{{param|tokenRef|OPTIONAL: Either the token [[getSelected|{{code|id}}]] or [[getTokenName|Token Name]] 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.}}
{{param|mapname|OPTIONAL: The name of the map to find the token.  Defaults to the current map.}}
{{Note|Token IDs are unique, but Token Names can be duplicated. Using Token Name when more than one token has the same name can produce unexpected results.}}


|example=
|example=

Revision as of 16:31, 14 May 2024

getTokenOpacity() Function

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

Usage

getTokenOpacity()
getTokenOpacity(tokenRef)
getTokenOpacity(tokenRef, mapname)

Parameters

  • tokenRef - OPTIONAL: Either the token id or Token Name 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.
Token IDs are unique, but Token Names can be duplicated. Using Token Name when more than one token has the same name can produce unexpected results.

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.