First, Unity4.6ui-------Canvas

Source: Internet
Author: User

In fact, I do not understand ... Write it casually.


====================================================================================



Rect Transform

Rect transform in the 2D UI, corresponding to the transform of 3D. Used to display the scale, position, size, angle, and so on in the adjustment 2DUI.

Position Coordinate position
Width/height Aspect size
Anchors Anchor Point
Pivot Center Point
Rotation Angle
Scale Zoom ratio

The anchors property is added in Rect transform, which includes anchor Min and Anchor Max. Anchors is used to specify how child UI elements are adjusted when the parent UI element is resized. The specific behavior is determined by anchor Min (bottom left) and anchor Max (top right) two anchor points. The coordinates are in the lower left of the rectangle (0, 0), and the upper right is (1, 1).

But in fact, Unity already provides a predefined pattern. Click on the top left corner of the rect transform to see the following common anchor patterns.

For example, in Top-left mode, the anchor point is at the upper-left corner of the parent element. If you pull the left and top borders of the parent element rectangle, the position of the child element changes as well. While pulling the other two edges does not change.
In middle or center mode, the Benzi elements on both sides of the pull axis move with it.
There is also the stretch mode, which stretches or compresses the child elements as they are pulled.


Update: Two editing modes: Blueprint: In this mode, the object does not rotate and zoom. Raw Edit: In this mode, adjusting the pivot and anchor of an object does not change the position and size of the object.

====================================================================================


Render Mode:

Screen Space-overlay: When you place the UI on top of the scene, adjust the scene size, or adjust the resolution, the canvas adjusts as well.

Screen Space-camera:canvas is rendered by a specific camera, and the settings of the camera affect the UI.

World Space: Make the canvas render like other objects in the scene.



Event Camera:.

Sorting Layer:

Order in Layer:



Pixel Perfect: Perfect pixel. After the click, the font is clearer.




Plane Distance: The distance from the camera to the plane.


====================================================================================

Canvas Scaler scale for canvas



Constant Pixel Size: Keeps the UI element size intact, regardless of the screen size.

Scale Factor: The proportions that maintain size. 100x100 Original Size 1=100x100 original twice times large 2=200x200

Reference Pixels per Unity 1 unit size in unity represents 100 pixels




The size with the screen size:ui element varies with the size of the display resolution.

Reference Resolution: Reference resolution, the larger the resolution, the smaller the Canvas scale.

Screen Match Mode:

Match Width or Height: Scales the UI elements according to the height or width of the reference resolution.

Expland: The resolution setting is not less than the resolution set by the canvas.

Shrink: Resolution is not greater than the resolution set by the canvas.

Match:width Zoom Reference width. Stretching reference Resolution y is not valid at this time.



The Constant physical Size:ui element retains the physical size regardless of how the screen sizes change.

Physical Unit: Physical unit

Fallback Screen DPI:

Default Sprite DPI:


====================================================================================



Each canvas has a graphic raycaster that gets the Ugui control that the user has selected. Multiple canvases set the order of event responses by setting the priority of graphic raycaster. When canvas uses world space or camera space, the block option of the Graphic Raycaster can be used to set occlusion targets.

Priority: Precedence.

Ignore reversed Graphic: Ignore what.

Blocking Objects:.

Blocking Mask:.





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.