UI Button Flashcards
“the button…”
“detects user input, and can trigger an event”
must be a child of
a canvas
button element requires:
- image script
2. button script
interactable
checkbox of button script; determines whether button accepts input
the normal state is automatically set by
the image component attached to the button element
transition mode
determines what the button looks like in a transition
color tint
default transition mode; same graphical element is used for each state.
target graphic: image to be tinted
normal, highlighted, pressed, disabled
determine color tint of each state
sprite swap
uses different sprite image for each state
animation
transition between states with animation. need to attach animator component to button element.
edit animation
in animation window, different animations for each state.
E.g.: in record mode, can change width for highlighted state.
navigation controls and UI
how the selection of UI elements is handled when using keyboard|controller input.
navigation mode can be set to
automatic
event system
part of UI framework
new event system added to scene when canvas created
onClickEvent
part of event system, called when UI element detects press+release