.. _stdlib_ui_texture_state_component: ============== UITextureState ============== +++++++ Classes +++++++ .. _struct-ui_texture_state_component-UITextureState: .. das:attribute:: UITextureState : UIVisualState .. note:: ``UIFrame`` component is automatically added to the node if it is not already present A UI component that changes its texture based on interaction state. :Fields: * **isMouseOver** : bool - True if the mouse is currently over the component. * **isMouseDown** : bool - True if the component is currently being pressed. * **isFocused** : bool - True if the component is currently focused. * **targetNode** : :ref:`NodeId ` - The node to set the texture on. If not set, the component's node will be used. * **activeTexture** : :ref:`TextureId ` = request_texture("%builtin_package/active_texture.png") - The texture when the component is active. Default is a white color texture. * **inactiveTexture** : :ref:`TextureId ` = request_texture("%builtin_package/inactive_texture.png") - The texture when the component is not interactable. Default is a gray color texture. * **hoverTexture** : :ref:`TextureId ` = request_texture("%builtin_package/focused_texture.png") - The texture when the component is hovered. Default is a light blue color texture. * **pressedTexture** : :ref:`TextureId ` = request_texture("%builtin_package/pressed_texture.png") - The texture when the component is pressed. Default is a blue color texture. * **focusedTexture** : :ref:`TextureId ` = request_texture("%builtin_package/focused_texture.png") - The texture when the component is focused. Default is a light blue color texture. .. _function-ui_texture_state_component_UITextureState_rq_on_initialize_UITextureState: .. das:function:: UITextureState.on_initialize() Initializes the component and sets up event listeners. .. _function-ui_texture_state_component_UITextureState_rq_on_destroy_UITextureState: .. das:function:: UITextureState.on_destroy() Removes event listeners. .. _function-ui_texture_state_component_UITextureState_rq_setInteractable_UITextureState_bool_bool: .. das:function:: UITextureState.setInteractable(val: bool; doFade: bool) Sets interactable state and updates the texture. :Arguments: * **val** : bool * **doFade** : bool .. _function-ui_texture_state_component_UITextureState_rq_calcTargetTexture_UITextureState: .. das:function:: UITextureState.calcTargetTexture() : TextureId Returns the target texture based on the current state. .. _function-ui_texture_state_component_UITextureState_rq_invalidate_UITextureState: .. das:function:: UITextureState.invalidate() Updates the current texture based on the target texture. .. _struct-ui_texture_state_component-UIBasicTextureState: .. das:attribute:: UIBasicTextureState : UIVisualState .. note:: ``UIFrame`` component is automatically added to the node if it is not already present A UI component that changes its texture based on focus and interactable state. :Fields: * **isFocused** : bool - True if the component is currently focused. * **targetNode** : :ref:`NodeId ` - The node to set the texture on. If not set, the component's node will be used. * **activeTexture** : :ref:`TextureId ` = request_texture("%builtin_package/active_texture.png") - The texture when the component is active. Default is a white color texture. * **inactiveTexture** : :ref:`TextureId ` = request_texture("%builtin_package/inactive_texture.png") - The texture when the component is not interactable. Default is a gray color texture. * **focusedTexture** : :ref:`TextureId ` = request_texture("%builtin_package/focused_texture.png") - The texture when the component is focused. .. _function-ui_texture_state_component_UIBasicTextureState_rq_on_initialize_UIBasicTextureState: .. das:function:: UIBasicTextureState.on_initialize() Initializes the component and sets up event listeners. .. _function-ui_texture_state_component_UIBasicTextureState_rq_on_destroy_UIBasicTextureState: .. das:function:: UIBasicTextureState.on_destroy() Removes event listeners. .. _function-ui_texture_state_component_UIBasicTextureState_rq_setInteractable_UIBasicTextureState_bool_bool: .. das:function:: UIBasicTextureState.setInteractable(val: bool; doFade: bool) Sets interactable state and updates the texture. :Arguments: * **val** : bool * **doFade** : bool .. _function-ui_texture_state_component_UIBasicTextureState_rq_calcTargetTexture_UIBasicTextureState: .. das:function:: UIBasicTextureState.calcTargetTexture() : TextureId Returns the target texture based on the current state. .. _function-ui_texture_state_component_UIBasicTextureState_rq_invalidate_UIBasicTextureState: .. das:function:: UIBasicTextureState.invalidate() Updates the current texture based on the target texture.