Component:ButtonToggle

From Resonite Wiki
Revision as of 00:07, 12 September 2024 by AmasterAmaster (talk | contribs) (This is no longer a stub. Style. Updated descriptions, added links.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Component image 
Button Toggle component as seen in the Scene Inspector


The ButtonValueToggle component can be used to make an IButton that switches a boolean value between true and false every time the button is pressed.

Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled.
TargetValue IField`1<Bool> The boolean to invert whenever the button is pressed.

Usage

To function, the component simply needs to be attached to a slot that also has a button component attached to it. From then on, pressing that button will activate the ButtonToggle, making it toggle its TargetValue from true to false or the other way round.

Examples

Related Components