UIColorState

Classes

UIColorState : UIVisualState

Note

UIFrame component is automatically added to the node if it is not already present

A UI component that tints its color based on interaction state.

Fields:
  • isMouseOver : bool - True if the mouse is currently over the component.

  • isMouseDown : bool - True if the mouse is currently being pressed.

  • isFocused : bool - True if the component is currently focused.

  • targetNode : NodeId - The node to tint. If not set, the component’s node will be used.

  • activeColor : float4 = float4(1f,1f,1f,1f) - The color when the component is active.

  • inactiveColor : float4 = float4(0.6f,0.6f,0.6f,1f) - The color when the component is not interactable.

  • hoverColor : float4 = float4(0.8f,0.9f,1f,1f) - The color when the component is hovered.

  • pressedColor : float4 = float4(0.6f,0.8f,1f,1f) - The color when the component is pressed.

  • focusedColor : float4 = float4(0.8f,0.9f,1f,1f) - The color when the component is focused.

  • fadeDuration : float = 0.1f - The duration of the fade effect when the state changes.

UIColorState.on_initialize()

Initializes the component and sets up event listeners.

UIColorState.on_destroy()

Removes event listeners.

UIColorState.setInteractable(val: bool; doFade: bool)

Sets interactable state and updates the color.

Arguments:
  • val : bool

  • doFade : bool

UIColorState.calcTargetColor(): float4

Returns the target color based on the current state.

UIColorState.invalidate(doFade: bool)

Updates the current color based on the target color.

Arguments:
  • doFade : bool

UIBasicColorState : UIVisualState

Note

UIFrame component is automatically added to the node if it is not already present

A UI component that tints its color based on focus and interactable state.

Fields:
  • isFocused : bool - True if the component is currently focused.

  • targetNode : NodeId - The node to tint. If not set, the component’s node will be used.

  • activeColor : float4 = float4(1f,1f,1f,1f) - The color when the component is active.

  • inactiveColor : float4 = float4(0.6f,0.6f,0.6f,1f) - The color when the component is not interactable.

  • focusedColor : float4 = float4(0.8f,0.9f,1f,1f) - The color when the component is focused.

  • fadeDuration : float = 0.1f - The duration of the fade effect when the state changes.

UIBasicColorState.on_initialize()

Initializes the component and sets up event listeners.

UIBasicColorState.on_destroy()

Removes event listeners.

UIBasicColorState.setInteractable(val: bool; doFade: bool)

Sets interactable state and updates the color.

Arguments:
  • val : bool

  • doFade : bool

UIBasicColorState.calcTargetColor(): float4

Returns the target color based on the current state.

UIBasicColorState.invalidate(doFade: bool)

Updates the current color based on the target color.

Arguments:
  • doFade : bool