How to create a HUD with the Unity GUI

Source: Internet
Author: User

1.

If you know the reason why, Nature knows it.

HUD refers to the head-up display, is set in the face, and your eyes fixed together, the HUD means that the interface, in general, we say that the HUD refers to the 3D space in the interface of some information (such as blood bars, injuries, etc.) on the interface, corresponding to 3D space projection to the location of screen space.

A simple, simple thing is a projection.

Although I have always thought that I learned the wild way, quite in the castle. Unfortunately found that more than my way, more than my base is worse than the students are more heinous.

No way, we use Ugui to realize this projection process.

First, prepare our 3D space.

Make a few boxes to get them to turn.

If even this do not know how to make classmates I advise you still close this page, if really not, or willing to continue to look down, look at the following three pictures.

Then, get a simple Ugui interface.

Get three image and distinguish it from the other.

Then the canvas is going to be placed in screenspace, because we're going to map to screen space, so we just need to map it once.

I like to let him zoom on the screen height, this does not affect the positioning, to see your needs.

Let the image display in the location of the cube

It's that simple, one-time mapping, problem solving.

Problems with sorting

One last question, HUD is that Gui,gui is sorted by GUI rules, but 3D objects are sorted by depth.

Need to make a mapping of the HUD's collation,

We're going to fix the canvas with a sorthud script.

It's good to rearrange the order according to the rules of depth.

Pay SVN address

http://code.taobao.org/svn/fightbeta/trunk/uGUISample/

How to create a HUD with the Unity GUI

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.