Component:Checkbox: Difference between revisions

From Resonite Wiki
m ProbablePrime moved page Checkbox (Component) to Component:Checkbox: Creating component Namespace
Automated: update Fields, Categories
Line 16: Line 16:
== Usage ==
== Usage ==
{{Table ComponentFields
{{Table ComponentFields
|State|Bool|  
|State|Bool|
|TargetState|IField`1|TypeString1=IField<Bool>|The Bool field to drive with the state of the checkbox
|TargetState|{{RootFieldType|RelayRef`1|[[Type:IField`1|IField`1]]&lt;[[Type:Bool|Bool]]&gt;}}|TypeAdv1=true|The Bool field to drive with the state of the checkbox
|CheckVisual|IField`1|TypeString2=IField<Bool>|The Bool field controlling visibility of the visual to display when the checkbox is in the checked state
|CheckVisual|{{RootFieldType|FieldDrive`1|[[Type:Bool|Bool]]}}|TypeAdv2=true|The Bool field controlling visibility of the visual to display when the checkbox is in the checked state
}}
}}


Line 34: Line 34:
== Related Components ==
== Related Components ==
</translate>
</translate>
[[Category:Components{{#translation:}}|Checkbox (Component){{#translation:}}]]
[[Category:Components{{#translation:}}|Checkbox]]
[[Category:ComponentStubs]]
[[Category:ComponentStubs]]
[[Category:Components:UIX:Interaction{{#translation:}}|Checkbox (Component){{#translation:}}]]
[[Category:Components:UIX:Interaction{{#translation:}}|Checkbox]]

Revision as of 21:39, 3 March 2024


This article or section is a Stub. You can help the Resonite Wiki by expanding it.


Component image 
Checkbox component as seen in the Scene Inspector


Intoduction

The Checkbox component is used with a Button component to provide a toggling state whenever the button is pressed.

Usage

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.
State Bool
TargetState direct RelayRef`1<IField`1<Bool>> The Bool field to drive with the state of the checkbox
CheckVisual field drive of Bool The Bool field controlling visibility of the visual to display when the checkbox is in the checked state

Behavior

Examples

Typically you'd have a child of the checkbox's slot containing an Image component, and that slot's Active property is driven using the CheckVisual property of the checkbox. In addition, you can have a SpriteProvider driving the Image component.

See also ProbablePrime's tutorial on checkboxes.

Related Components