"Turn" (ii) Unity4.6ugui Chinese Course document-------Overview-ugui Canvas

Source: Internet
Author: User

Original first, please poke: (ii) Unity4.6ugui Chinese Course document-------Overview-ugui Canvas

The UI system allows you to quickly and intuitively create a user interface (UI). This is an introduction to the main features of Unity's new UI system.

OneUI Overview Overview

In this overview, we go through the basics of the UI system. We'll start by introducing the canvas and putting all the UI elements inside, and using the Rect Tool and rect Transform UI element layout. Then we take a look at visual elements like Text and Image, and interactive controls such as button buttons and Sliders Slider.

1.Canvas

the canvas canvas is the area that holds all of the UI elements. A canvas is a canvas component component on a game object , and all UI elements must be sub-objects of the canvas.

When you want to create a new UI element, such as Image, click menu creation:gameobject > UI > Image or hierarchy panel create->ui-> Image, and a canvas is created automatically if a canvas already exists in the scene. Then the new UI element image is created and is directly on the long-existing canvas.

The canvas area is displayed as a rectangle in the scene view. This makes it easy to locate UI elements that can be seen at all times without the need for a game view.

There is a render mode setting on the canvas: screenspace (overlay/camare) or world space, where you can set the render style.  

1.1 screen Space-overlay

In this rendering mode, UI elements are rendered on the screen in the scene. If the screen size changes or changes the resolution, the canvas will automatically change size to match nicely.

UI in screen space overlay canvas

1.2 screen Space-camera

This is similar to screen Space-overlay, but in this rendering mode, the canvas is placed at a given distance before the specified camera. The UI elements of this specified camera are rendered, which means that the camera settings affects the display of the UI. If the camera is set to perspective, theUI element will be rendered under perspective, and theperspective distortion number can be controlled by setting the camera field size to be watched . If the screen resizes or changes the resolution or the camera cone range changes, the canvas will automatically change size, as well as match.

UI in the screen space camera canvas

1.3 World Space

This rendering mode causes the canvas to behave in any other object in the scene. You can manually use its Rect transform to set the size of the canvas, and the UI elements will be rendered in front of or behind other objects in a 3D-based scenario. This is useful for all UI, they are part of world space and are sometimes referred to as plot interfaces.

UI in World space canvas

"Turn" (ii) Unity4.6ugui Chinese Course document-------Overview-ugui Canvas

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.