isBarVisible: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(17 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
= | {{MacroFunction | ||
Returns | |name=isBarVisible | ||
|version=1.3b46 | |||
|description= | |||
Returns {{true}} if the specified [[Introduction to Bars|Token Bar]] on the [[Current Token]] is visible, or {{false}} if it is not. | |||
=== | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h: | isBarVisible(bar) | ||
</ | isBarVisible(bar, id) | ||
isBarVisible(bar, id, mapname) | |||
</syntaxhighlight> | |||
'''Parameters''' | |||
{{param|bar|A string that contains the name of the bar that has its visibility checked.}} | |||
{{param|id|The token {{code|id}} of the token which has its bar checked, defaults to the [[Current Token]]. {{TrustedParameter}} }} | |||
{{param|mapname|The name of the map to find the token. Defaults to the current map.}} | |||
|examples= | |||
Displays {{code|The health bar is visible!}} if the bar named {{code|Health}} is set to visible; otherwise it displays {{code|The health bar is not visible!}}. | |||
<syntaxhighlight lang="mtmacro" line> | |||
[if(isBarVisible("Health")), code: | |||
{ | |||
The health bar is visible! | |||
};{ | |||
The health bar is not visible! | |||
}] | |||
</syntaxhighlight> | |||
Toggles the visibility of the bar named {{code|Fatigue}}. | |||
<syntaxhighlight lang="mtmacro" line> | |||
[h: setBarVisible("Fatigue", !isBarVisible("Fatigue"))] | |||
[h: abort(0)] | |||
</syntaxhighlight> | |||
|also= | |||
{{func|setBarVisible}}, | |||
{{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]] |
Latest revision as of 20:23, 15 March 2023
isBarVisible() Function
• Introduced in version 1.3b46
Returns
true
(1
) if the specified Token Bar on the Current Token is visible, or false
(0
) if it is not.Usage
isBarVisible(bar)
isBarVisible(bar, id)
isBarVisible(bar, id, mapname)
Parameters
bar
- A string that contains the name of the bar that has its visibility checked.id
- The tokenid
of the token which has its bar checked, 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.
Examples
Displays
The health bar is visible!
if the bar named Health
is set to visible; otherwise it displays The health bar is not visible!
.
[if(isBarVisible("Health")), code:
{
The health bar is visible!
};{
The health bar is not visible!
}]
Toggles the visibility of the bar named Fatigue
.
[h: setBarVisible("Fatigue", !isBarVisible("Fatigue"))]
[h: abort(0)]
See Also
Version Changes
- 1.5.7 - Added
id
andmapname
parameter options.