setBarVisible: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Unifying Current Token red link.)
No edit summary
Line 9: Line 9:
setBarVisible(name, value)
setBarVisible(name, value)
</source>
</source>
'''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|id|The token {{code|id}} 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.}}


|examples=
|examples=
Line 20: Line 26:
[h: setBarVisible("health", 0)]
[h: setBarVisible("health", 0)]
</source>
</source>
|changes=
{{change|1.5.7|Added {{code|id}} and {{code|mapname}} parameter option.}}
}}
}}
[[Category:Bar Function]]
[[Category:Bar Function]]

Revision as of 18:21, 9 October 2019

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)

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.
  • id - The token id 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.

Examples

Make "health" bar for the Current Token visible.
[h: setBarVisible("health", 1)]

Hide "health" bar for the Current Token.

[h: setBarVisible("health", 0)]

Version Changes

  • 1.5.7 - Added id and mapname parameter option.