Unity3d's Ugui study notes (i): Ugui introduction and Canvas

Source: Internet
Author: User

Ugui is an official UI system provided by unity3d4.6, supporting the development of 2D and 3D UIs.

Unity3d UI History Ongui

Before Unity4.6, the official offer is the Ongui function to develop the UI interface, of course, the problem is also more, first of all, not support visual development, second, the UI is always located above all 3D objects, can not achieve the effect of adding 3D model on the UI.

This system is often used to develop the interface in the Unity editor or to quickly build some debugging interfaces.

NGUI

The famous Ngui can be seen as a must-have plugin for the development of Unity Games, support visual development, and support the development of 2D and 3D UIs, as well as the ability to display models and particles on the UI.

I also have a set of Ngui study notes, still in the perfect, the details can be clicked: http://www.cnblogs.com/hammerc/p/4481597.html

Ugui

First of all, this official UI system was developed by Unity's Ngui author, so the operation of the two are broadly consistent, while Ugui is open source system, we can get Ugui source in the following connection:

Https://bitbucket.org/Unity-Technologies/ui/src

Official case

You can download an official Ugui case:

https://www.assetstore.unity3d.com/en/#!/content/25468

Canvas

In Ugui, whose root container is canvas, we find that canvas and EventSystem are generated by default, regardless of whether any UI is added to the scene.

All of the UI must be added as a child of the canvas.

Let's take a closer look at some of the canvas's settings:

Canvas

Render mode: The following

    1. Screen Space-overlay:2dui, always displayed at the front of the display.
    2. Screen space-camera:2d and 3DUI, bound to the specified camera, can display the contents of the content, while the UI can be rotated 3D, the UI can get 3D effect.
    3. World Space:3dui, there is a UI in 3D space.

Pixel Perfect: Whether the UI is displayed in a pixel fashion.

Sort order: The pre-and post-display arrangement settings between different canvases.

Canvas Scaler

Ui scale Mode:ui Zoom mode, as follows:

    1. Constant Pixel Size: The pixel size is always the same, that is, a 100*100 picture occupies 100*100 pixels at any resolution. This is used on a typical PC because the PC-side resolution is not very different.
    2. Scale with screen size: Do not care about the actual pixel size of the picture, but only the width and height value, if this value is 1000, then 100 height of the picture at any resolution will only occupy the size of screen 1/10. The general mobile will use this approach because the resolution of the mobile side is significantly different.
    3. Constant physical Size: Scales according to the physical units.
Graphic Raycaster

The ray adjustment in the scene for the configuration of the interactive event.

EventSystem

Let's take a brief look at EventSystem, followed by notes detailing how to use EventSystem:

There are 3 scripts bound here, you can find in addition to their own eventsystem, but also added about the standard input (i.e. the mouse keyboard) and touch input two input scripts.

Unity3d's Ugui study notes (i): Ugui introduction and 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.