setBarVisible: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) m (Added version.) |
No edit summary |
||
(10 intermediate revisions by 5 users not shown) | |||
Line 3: | Line 3: | ||
|version=1.3b46 | |version=1.3b46 | ||
|description= | |description= | ||
Sets if the specified [[Token:bar|bar]] for the [[ | Sets if the specified [[Token:bar|bar]] for the [[Current Token]] is visible or not. If the value is non zero then the [[Token:bar|bar]] is visible, if it is 0 it is not visible. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
setBarVisible(name, value) | setBarVisible(name, value) | ||
</ | setBarVisible(name, value, tokenRef) | ||
setBarVisible(name, value, tokenRef, mapRef) | |||
</syntaxhighlight> | |||
'''Parameters''' | |||
{{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|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|mapRef|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.}} | |||
|examples= | |examples= | ||
Make "health" [[Token:bar|bar]] for the [[Token: | Make "health" [[Token:bar|bar]] for the [[Current Token]] visible. | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h: setBarVisible(" | [h: setBarVisible("Health", 1)] | ||
</ | </syntaxhighlight> | ||
Hide "health" [[Token:bar|bar]] for the [[Current Token]]. | |||
<syntaxhighlight lang="mtmacro" line> | |||
[h: setBarVisible("Health", 0)] | |||
</syntaxhighlight> | |||
|also= | |||
{{func|isBarVisible}}, | |||
{{func|getBar}}, | |||
{{func|setBar}} | |||
|changes= | |||
{{change|1.5.7|Added {{code|id}} and {{code|mapname}} parameter options.}} | |||
}} | }} | ||
==Related Pages== | |||
* [[HP and Health Bars]] | |||
* [[bar.name|The <code>bar.name</code> special variable]] | |||
[[Category:Bar Function]] | [[Category:Bar Function]] |
Latest revision as of 23:59, 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, mapRef)
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.
mapRef
- 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.
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.