.. _stdlib_ui_color_state_component: ============ UIColorState ============ +++++++ Classes +++++++ .. _struct-ui_color_state_component-UIColorState: .. das:attribute:: 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** : :ref:`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. .. _function-ui_color_state_component_UIColorState_rq_on_initialize_UIColorState: .. das:function:: UIColorState.on_initialize() Initializes the component and sets up event listeners. .. _function-ui_color_state_component_UIColorState_rq_on_destroy_UIColorState: .. das:function:: UIColorState.on_destroy() Removes event listeners. .. _function-ui_color_state_component_UIColorState_rq_setInteractable_UIColorState_bool_bool: .. das:function:: UIColorState.setInteractable(val: bool; doFade: bool) Sets interactable state and updates the color. :Arguments: * **val** : bool * **doFade** : bool .. _function-ui_color_state_component_UIColorState_rq_calcTargetColor_UIColorState: .. das:function:: UIColorState.calcTargetColor() : float4 Returns the target color based on the current state. .. _function-ui_color_state_component_UIColorState_rq_invalidate_UIColorState_bool: .. das:function:: UIColorState.invalidate(doFade: bool) Updates the current color based on the target color. :Arguments: * **doFade** : bool .. _struct-ui_color_state_component-UIBasicColorState: .. das:attribute:: 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** : :ref:`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. .. _function-ui_color_state_component_UIBasicColorState_rq_on_initialize_UIBasicColorState: .. das:function:: UIBasicColorState.on_initialize() Initializes the component and sets up event listeners. .. _function-ui_color_state_component_UIBasicColorState_rq_on_destroy_UIBasicColorState: .. das:function:: UIBasicColorState.on_destroy() Removes event listeners. .. _function-ui_color_state_component_UIBasicColorState_rq_setInteractable_UIBasicColorState_bool_bool: .. das:function:: UIBasicColorState.setInteractable(val: bool; doFade: bool) Sets interactable state and updates the color. :Arguments: * **val** : bool * **doFade** : bool .. _function-ui_color_state_component_UIBasicColorState_rq_calcTargetColor_UIBasicColorState: .. das:function:: UIBasicColorState.calcTargetColor() : float4 Returns the target color based on the current state. .. _function-ui_color_state_component_UIBasicColorState_rq_invalidate_UIBasicColorState_bool: .. das:function:: UIBasicColorState.invalidate(doFade: bool) Updates the current color based on the target color. :Arguments: * **doFade** : bool