Unity2017.1 official Ugui document translator--interaction components

Source: Internet
Author: User

Interaction Components Interaction

This section covers the UI system, handles interaction, such as mouse or touch events and interaction us ing a keyboard or controller.

The interaction components is not visible on their own, and must is combined with one or more visual elements in order to Work correctly.

This section includes components that handle interactions in the UI system, such as mouse, touch events, and interaction using the keyboard or controller

The interaction component itself is not visible and must be combined with one or more visual components to work properly

Common functionality

General functions

The most of the interaction components has some things in common. They is selectables, which means they has shared built-in functionality for visualising transitions between states (norm Al, highlighted, pressed, disabled), and for navigation to other selectables using keyboard or controller. This shared functionality are described on the selectable page.

The interaction components has at least one unityevent which is invoked when user interacts with the component in specific The. The UI system catches and logs any exceptions this propagate out of code attached to unityevent.

Most of the interaction components have some common parts. They can be selected, meaning they share built-in functionality to transform the visual state (normal, highlighted, pressed, not available), as well as navigating to other selectble components via the keyboard or controller. These shared features are described in detail in selectable. (Selectable is the base class for many interactive components in the source code, after all, many basic functions are generic)

At least one unityevent will be called when the user interacts with a specific method and an interactive component. The UI system captures and logs all outgoing exceptions from the code attached to the Unityevent

Button

Button

A Button has A OnClick unityevent to define what it would do when clicked.

Button has an OnClick event to define what happens when it is clicked

See the button page for details on using the button component.

View detailed methods for using the button component on the button page

Toggle

Toggle Key

A Toggle have an are on checkboxes that determines whether the Toggle are currently on or off. This value was flipped when the user clicks the Toggle, and a visual checkmark can being turned on or off accordingly. It also has a onvaluechanged unityevent to define what it would do when the value is changed.

The Toggle key has a check box that determines whether the selection key is open. This value is reversed when the user presses the toggle, and then a visual selection tag changes. It also has a onvaluechanged event to define what to do when the value of the check box changes

See the Toggle page for details on using the Toggle component.

View detailed methods for using toggle components on the Toggle page

Toggle Group

Toggle Button Group

A Toggle group can is used to Group a set of toggles that is mutually exclusive. Toggles that belong to the same group is constrained so, only one of the them can is selected at a time-selecting one o F them automatically deselects all the others.

Toggle group can be used to divide a group of Toggle into a group, and they are mutually exclusive. Toggle that belong to the same group are limited, only one at a time can be selected-one of them will automatically close the other

See the Toggle Group page for details on using the Toggle group component.

View detailed methods for using toggle group components on the Toggle Group page

Slider

Sliding block

A Slider has a decimal number Value, the user can drag between a minimum and maximum Value. It can be either horizontal or vertical. It also have a onvaluechanged unityevent to define what it would do when the value is changed.

The slider intentionally has a small value that the user can drag between the minimum and maximum values. It can be horizontal or vertical. It also has a onvaluechanged event to define what to do after the value changes

See the slider page for details on using the slider component.

See detailed methods for using the slider component on the slider page

Scrollbar

Slide Bar

A Scrollbar has a decimal number Value between 0 and 1. When the user drags the scrollbar, the value changes accordingly.

Scrollbars is often used together with a Scroll Rect and a Mask to create a Scroll view. The Scrollbar has a Size value between 0 and 1 so determines how big the handle is as a fraction of the entire Scrollbar Length. This was often controlled from another component to indicate what big a proportion of the content in a scroll view is VISIBL E. The Scroll Rect component can automatically do this.

The Scrollbar can be either horizontal or vertical. It also have a onvaluechanged unityevent to define what it would do when the value is changed.

The slider has a small value between 0-1. When the user drags the scrollbar, the value changes accordingly

Scrollbars often creates a scroll View together with Scrollrect and mask. Scroll bar has a size value between 0 and 1, which determines the fractional value of the handle for the entire scrollbar length. This is typically controlled by other components to indicate that content visible in ScrollView is the percentage of total content. The Scroll rect component can set it automatically.

See the Scrollbar page for details on using the Scrollbar component.

See detailed methods for using the slider component on the slider page

Dropdown

Drop-down menu

A Dropdown has a list of options to choose from. A text string and optionally an image can is specified for each option, and can is set either in the Inspector or Dynamica Lly from code. It had a onvaluechanged unityevent to define what it would do when the currently chosen option was changed.

Dropdown has a list of options to choose from. Each option can specify text and pictures (optional), which can be set in inspector or dynamically in code. It also has a Onvaluechange event to define what to do when the election changes

See the Dropdown page for details on using the Dropdown component.

View detailed methods for using dropdown components on the dropdown page

Input Field

Input field

An Input Field was used to make the text of a text Element editable by the user. It had a unityevent to define what it would do when the text content was changed, and an another to define what it would do W Hen the user has finished editing it.

Input Filed is used to allow text elements to be edited by the user. It defines the event that the text content changes and the text edits end two events to define what to do separately in both cases.

See the Input field page for details on using the input field component.

View detailed methods for using the input files component on the input filed page

Scroll Rect (Scroll View)

Scrolling Rectangle (scrolling view)

A Scroll Rect can is used when content is takes up a lot of space needs to being displayed in a small area. The Scroll Rect provides functionality to Scroll over this content.

Usually a Scroll Rect is combined with a Mask in order to create a Scroll view, where only the scrollable content inside T He Scroll Rect is visible. It can also additionally is combined with one or both Scrollbars that can is dragged to scroll horizontally or vertically.

Scroll rect is used for content to occupy a lot of place but to be realistic in a very small area. Scroll RECT provides the ability to scroll through content

In general, Scroll rect and mask combine to create a srcoll view, and only the content within the Srcoll rect is visible. By combining 1 or 2 scroll bar It is also dragged and scrolled, it can also be dragged horizontally or vertically scrolling

See the Scroll rect page for details on using the Scroll rect component.

View detailed methods for using the scroll RECT component on the scroll rect page

Unity2017.1 official Ugui document translator--interaction components

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.