isBarVisible: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Just expanded the functionality a bit.)
(Completed the article.)
Line 1: Line 1:
{{stub}}
{{MacroFunction
{{MacroFunction
|name=isBarVisible
|name=isBarVisible
|version=1.3b46
|version=1.3b46
|description=
|description=
Returns 1 if the [[Token:bar|Token Bar]] specified by "name" on the [[Current Token]] is visible, or 0 if it is not.
Returns {{true}} if the specified [[Token Bar]] on the [[Current Token]] is visible, or {{false}} if it is not.


|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
isBarVisible(name)
isBarVisible(bar)
</source>
</source>
}}
'''Parameters'''
{{Clarify|
{{param|bar|A string that contains the name of the bar that has its visibility checked.}}
What is the syntax if the token has more than one bar visible? Will this return {{code|1}} if '''any''' bar is visible?
 
|example=
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!}}.
<source lang="mtmacro" line>
[if(isBarVisible("Health"), code:
{
    The health bar is visible!
};{
    The health bar is not visible!
}]
</source>
 
Toggles the visibility of the bar named {{code|Fatigue}}.
<source lang="mtmacro" line>
[h: setBarVisible("Fatigue", !isBarVisible("Fatigue"))]
[h: abort(0)]
</source>
 
|also=
{{func|setBarVisible}},
{{func|getBar}},
{{func|setBar}}
 
}}
}}
[[Category:Bar Function]]
[[Category:Bar Function]]

Revision as of 11:41, 30 May 2009

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)

Parameters

  • bar - A string that contains the name of the bar that has its visibility checked.

Example

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