NGUI: UIAnchor
The Anchor script can be used for multiple purposes, which are useful in Example0.
1. As long as a half-pixel offset is provided, it can precisely display the position of a control on Windows (only the sub-control of this Anchor is affected)
2. If it is attached to an object, it can attach the object to the corner or edge of the screen.
Parameters
UI Camera is the Camera that renders these objects. If not set manually, it automatically sets the Camera in a scenario.
Side. You can set four corners, four sides, and a central point.
Half Pixel Offset allows an object to be displayed on windows with a Half-Pixel Offset. Select this option on the 2D UI.
Depth Offset is used to adjust the Depth of the location calculated by UIAnchor. It mainly acts on fluoroscopy-based cameras. This value is the coordinates of the world, similar to the camera's near-distance cropping surface.
The Relative Offset of Relative Offset allows you to set the Offset of an object in the unit of half-aspect ratio of the screen.
Tips
1. If a UIAnchor is attached to an object, its transform value cannot be manually modified-they are controlled by scripts. If you want to add an offset to the anchor, add a child object to it. For example, to ensure that your control is always in the (100,100) position, your object structure should be: UI-> Anchor-> Offset-> Widget.
2. if you want to set the position of a widget to 25% on the Left of the screen, you can set it as a sub-object of UIAnchor, and set the Side of UIAnchor to Left, set the X value of Relateive Offset to 0.25.
Address: http://blog.csdn.net/daiguangda/article/details/7850155
NGUI: UIAnchor
The Anchor script can be used for multiple purposes, which are useful in Example0.
1. As long as a half-pixel offset is provided, it can precisely display the position of a control on Windows (only the sub-control of this Anchor is affected)
2. If it is attached to an object, it can attach the object to the corner or edge of the screen.
Parameters
UI Camera is the Camera that renders these objects. If not set manually, it automatically sets the Camera in a scenario.
Side. You can set four corners, four sides, and a central point.
Half Pixel Offset allows an object to be displayed on windows with a Half-Pixel Offset. Select this option on the 2D UI.
Depth Offset is used to adjust the Depth of the location calculated by UIAnchor. It mainly acts on fluoroscopy-based cameras. This value is the coordinates of the world, similar to the camera's near-distance cropping surface.
The Relative Offset of Relative Offset allows you to set the Offset of an object in the unit of half-aspect ratio of the screen.
Tips
1. If a UIAnchor is attached to an object, its transform value cannot be manually modified-they are controlled by scripts. If you want to add an offset to the anchor, add a child object to it. For example, to ensure that your control is always in the (100,100) position, your object structure should be: UI-> Anchor-> Offset-> Widget.
2. if you want to set the position of a widget to 25% on the Left of the screen, you can set it as a sub-object of UIAnchor, and set the Side of UIAnchor to Left, set the X value of Relateive Offset to 0.25.
Address: http://blog.csdn.net/daiguangda/article/details/7850155