To learn about the button control today, the button control is actually formed by the text,button,image component. Here's a quick introduction to the button component
Interactable: represents whether the component interacts, and we have previously let the component interact with the usual components. Enable = False to do so. Now just change the properties to
Transition: This word translates to the meaning of transition, letting some state-> Transition-> another state. It has four types of transitions:
None: No transitions
Color Tint: Transition of colour change
Sprite Swap: Picture change transitions
Animation: Transition by some animations
Color Tinit Colors Transition state:
Normal Color: |
Default state |
Highlighted Color: |
Mouse hover State |
Pressed Color: |
Click Down Status |
diabled Color: |
Disabled state |
Color Multiplier |
When the color multiplier is set high, it turns white. |
Fade Duration |
State switching, color easing time |
Sprite Swap: Picture transition state: The same as the state of the color, except that each state renders a different picture
Naviation This attribute I do not quite understand, seemingly is auxiliary in the page layout! (If you know the small partners please leave a message to study the next OH)
Animation: Animation transitions, Previous button animations we generally use itween or Ngui built-in animation components to zoom in and out when the mouse moves up and down.
To learn here you need to first understand the animation and animation state machine.
Click: Auto Generate Animation button, will automatically help you to create an animation state machine. (You can also manually create your own, as long as the animation block name, switch state parameters as well)
You can set for each state, the game object a component of the property changes, select the Game object, click Window–> Animation Open the window, you can look at the.
Let's add a frame animation for the button pressed state.
Button event: Simple onclick event with three selection boxes
1. Runtime only executes this event in all environments, off means no execution, Editor and runtime (I don't quite understand this option =.=),
The other two checkboxes are game objects, with the function selected for execution.
Ugui Button control