getTokenOpacity: Difference between revisions
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...") |
No edit summary |
||
(11 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= | |description= | ||
Returns the opacity value of the corresponding token. | |||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro"> | ||
getTokenOpacity( | getTokenOpacity() | ||
</ | getTokenOpacity(tokenRef) | ||
getTokenOpacity(tokenRef, mapRef) | |||
</syntaxhighlight> | |||
'''Parameters''' | '''Parameters''' | ||
{{param| | {{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|mapRef|OPTIONAL: The Name or ID 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= | ||
< | <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 = | [h, token("Dragon"): opacity = getTokenOpacity()] | ||
</ | </syntaxhighlight> | ||
|changes={{change|1.5.4|Added {{code|mapname}} parameter option.}} | |||
}} | }} | ||
[[Category: | [[Category:Token Function]] |
Latest revision as of 23:59, 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, mapRef)
Parameters
tokenRef
- OPTIONAL: Either the tokenid
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.
mapRef
- OPTIONAL: The Name or ID 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.