Component:Button: Difference between revisions

From Resonite Wiki
m ProbablePrime moved page Button (Component) to Component:Button: Creating component Namespace
Expanded Introduction, clarified more field desciptions
Line 11: Line 11:
== Intoduction ==
== Intoduction ==


A Button allows for users to click on its slot. It provides visual feedback by altering the colors of graphics on the slot, and is needed for several other components, such as [[Text Field (Component)|Text Field]], to function.
A Button is a [[UIX]] component allows for users to click on its Rect. It provides visual feedback by altering the colors of graphics on the Rect, and is able to trigger several other components, such as [[Text Field (Component)|Text Field]], by using the [[Button Events]] system.


<!--T:3-->
<!--T:3-->
Line 28: Line 28:
|HoverVibrate|VibratePreset|How a controller should vibrate when hovering over this button
|HoverVibrate|VibratePreset|How a controller should vibrate when hovering over this button
|PressVibrate|VibratePreset|How a controller should vibrate when pressing this button
|PressVibrate|VibratePreset|How a controller should vibrate when pressing this button
|ClearFocusOnPress|Bool|Makes the button stop being hovered when a press occurs
|ClearFocusOnPress|Bool|Defocuses any textfield (or other IFocusables) when pressed
|PassThroughHorizontalMovement|Bool|FIXME
|PassThroughHorizontalMovement|Bool|Whether or not press-and-drag movement should be passed to higher components
|PassThroughVerticalMovement|Bool|FIXME
(such as [[Scroll Rect (Component)|Scroll Rect]]s)
|PassThroughVerticalMovement|Bool|Whether or not press-and-drag movement should be passed to higher components
(such as [[Scroll Rect (Component)|Scroll Rect]]s)
|RequireLockInToPress|Bool|FIXME
|RequireLockInToPress|Bool|FIXME
|RequireInitialPress|Bool|FIXME
|RequireInitialPress|Bool|FIXME

Revision as of 05:59, 23 January 2024


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


Component image 
Button component as seen in the Scene Inspector


Intoduction

A Button is a UIX component allows for users to click on its Rect. It provides visual feedback by altering the colors of graphics on the Rect, and is able to trigger several other components, such as Text Field, by using the Button Events system.

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.
BaseColor Color The color that all other tints will be based on
ColorDrivers ColorDriver A list of sets of colors. Each one points at another component's color, and determines how it looks normally, when highlighted, when pressed, and when disabled
__legacy_NormalColor Color Internal
__legacy_HighlightColor Color Internal
__legacy_PressColor Color Internal
__legacy_DisabledColor Color Internal
__legacy_TintColorMode ColorMode Internal
__legacy_ColorDrive Color Internal
IsPressed Bool True if the button is being pressed
IsHovering Bool True if someone is hovering over the button
HoverVibrate VibratePreset How a controller should vibrate when hovering over this button
PressVibrate VibratePreset How a controller should vibrate when pressing this button
ClearFocusOnPress Bool Defocuses any textfield (or other IFocusables) when pressed
PassThroughHorizontalMovement Bool Whether or not press-and-drag movement should be passed to higher components

(such as Scroll Rects)

PassThroughVerticalMovement Bool Whether or not press-and-drag movement should be passed to higher components

(such as Scroll Rects)

RequireLockInToPress Bool FIXME
RequireInitialPress Bool FIXME
PressPoint Float2 FIXME
Pressed ButtonEventHandler Internal
Pressing ButtonEventHandler Internal
Released ButtonEventHandler Internal
HoverEnter ButtonEventHandler Internal
HoverStay ButtonEventHandler Internal
HoverLeave ButtonEventHandler Internal

Behavior

Examples

Related Components