Home
  • English
  • 中文
Home
  • English
  • 中文
  • Get Started

    • Install
    • Hello LGUI
    • Custom Button
    • Use custom font
    • Prefab workflow
    • Interaction
    • Button from scratch
  • Sample Projects

    • Sample Projects
  • Prefab Workflow

    • LGUI Prefab
    • PrefabEditor
    • LGUILifeCycleBehaviour
    • LGUIPrefabInterface
  • Rendering

    • LGUICanvas
    • Screen Space Overlay
    • World Space - UE Renderer
    • World Space - LGUI Renderer
    • LGUI render flow
    • UICanvasGroup
  • Visual Components

    • UIText
    • UIEffect
    • TextAnimation
    • UIBackgroundBlur
    • UIBackgroundPixelate
  • Events

    • LGUIEventDelegate
    • LGUIEventSystem
  • Interaction Components

    • UISelectable component
  • Layout

    • Basic Layout
    • Auto Layout
  • Tween Animation

    • LTween
    • Use LTween for UI element
  • Performance

    • LGUI Stat
  • ReleaseNotes

    • LGUI 3.x
    • LGUI 2.x
  • FAQ

    • Why use prefab?
    • Update project from LGUI2 to LGUI3
    • Project 3d world position to LGUI's screen 2d position
    • Deproject LGUI's screen position to world
    • Use custom material for UI elements
    • Disable interaction component
    • Find Child by DisplayName
    • Get actor or component inside prefab
    • Anti-aliasing

UISelectable component

UISelectable component is the base class for most Interaction components, and is the key for keyboard/controller input.

Property:Function:
AllowEventBubbleUpAllow passed-in LGUI Pointer Event to pass out? If not, the pointer event just stop here.
TransitionWithin a UISelectable component there are several Transition Options depending on what state the UISelectable is currently in. The different states are: normal, highlighted, pressed and disabled.
NavigationThere are also a number of Navigation Options to control how keyboard navigation of the controls is implemented

Transition Options

Within a UISelectable component there are several Transition Options depending on what state the UISelectable is currently in. The different states are: normal, highlighted, pressed and disabled.

Transition Options:Function:
NoneThis option is for the button to have no state effects at all.
Color TintChanges the colour of the button depending on what state it is in. It is possible to select the colour for each individual state. It is also possible to set the Fade Duration between the different states. The higher the number is, the slower the fade between colors will be.
Sprite SwapAllows different sprites to display depending on what state the button is currently in, the sprites can be customised.
TransitionComponentAllows an user implemented UISelectableTransition to behave on the state of the button, the component must exist on TransitionTarget actor in order to use custom transition.
Each Transition option (except None) provides additional options for controlling the transitions. We'll go into details with those in each of the sections below.

Color Tint

Property:Function:
TransitionTargetThe UIBaseRenderable actor used for this UISelectable component.
Normal ColorThe normal color of the control. This will override target color, not multiply the color value. So don't panic when TransitionTarget's color change when hit play, just match this NormalColor with your TransitionTarget's color.
Highlighted ColorThe color of the control when it is highlighted
PressedColorThe color of the control when it is pressed
DisabledColorThe color of the control when it is disabled
FadeDurationThe time taken, in seconds, to fade from one state to another

Sprite Swap

Property:Function:
TransitionTargetThe UISprite actor used for this UISelectable component.
Normal SpriteSprite to use when the control is normal
Highlighted SpriteSprite to use when the control is highlighted
Pressed SpriteSprite to use when the control is pressed
Disabled SpriteSprite to use when the control is disabled

UISelectableTransition component

When transition state change, the following callback event will execute on UISelectableTransition component.

  • OnNormal: Called when UISelectable's transition state become normal
  • OnHighlighted: Called when UISelectable's transition state become highlighted
  • OnPressed: Called when UISelectable's transition state become pressed
  • OnDisabled: Called when UISelectable's transition state become disabled
  • ReceiveOnStartCustomTransition: This gives us an opportunity to do transition on more state than just provided above, use parameter InTransitionName call tell different state. For example, UIToggleComponent use "On"/"Off" for toggle on/off.

Each callback event get a bool parameter InImmediateSet, if it is true then you must set properties immediately (mostly for initialize or editor use), if false then you can use a tween animation.

Last Updated:
Contributors: lf2007hf