setBarVisible: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
<syntaxhighlight lang="mtmacro" line> | <syntaxhighlight lang="mtmacro" line> | ||
setBarVisible(name, value) | setBarVisible(name, value) | ||
setBarVisible(name, value, | setBarVisible(name, value, tokenRef) | ||
setBarVisible(name, value, | setBarVisible(name, value, tokenRef, mapname) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 15: | Line 15: | ||
{{param|bar|A string that contains the name of the bar that has its visibility set.}} | {{param|bar|A string that contains the name of the bar that has its visibility set.}} | ||
{{param|value|The visibility value of the bar, either 0 or 1.}} | {{param|value|The visibility value of the bar, either 0 or 1.}} | ||
{{param| | {{param|tokenRef|Either the token [[getSelected|{{code|id}}]] or [[getTokenName|Token Name]] of the token which has its bar visibility set, defaults to the [[Current Token]]. {{TrustedParameter}} }} | ||
{{param|mapname|The name of the map to find the token. Defaults to the current map.}} | {{param|mapname|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.}} | |||
|examples= | |examples= |
Revision as of 17:17, 23 May 2024
setBarVisible() Function
• Introduced in version 1.3b46
Sets if the specified bar for the Current Token is visible or not. If the value is non zero then the bar is visible, if it is 0 it is not visible.
Usage
setBarVisible(name, value)
setBarVisible(name, value, tokenRef)
setBarVisible(name, value, tokenRef, mapname)
Parameters
bar
- A string that contains the name of the bar that has its visibility set.value
- The visibility value of the bar, either 0 or 1.tokenRef
- Either the tokenid
or Token Name of the token which has its bar visibility set, defaults to the Current Token.Note: This parameter can only be used in a Trusted Macro.
mapname
- 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.
Examples
Make "health" bar for the Current Token visible.
[h: setBarVisible("Health", 1)]
Hide "health" bar for the Current Token.
[h: setBarVisible("Health", 0)]
See Also
Version Changes
- 1.5.7 - Added
id
andmapname
parameter options.