How the UI Works
The position of the UI control is in the Red Box (window) of the UI root, which is the z axis of the UI control, the z axis of the camera, the z axis of the UI root is 0, because the 2D UI is purely 2D images are displayed hierarchically, without three-dimensional effects, so they are directly attached to the window as long as the UI controls Within the red frame of the root, the UI will be displayed on the game normally.
The most essential meaning of the UI is that the UI camera is an orthographic camera.
How the 3D UI works
Under the 3D UI, the UI controls are created in a three-dimensional space, and the camera is a perspective camera, which differs greatly from the 2D UI because the 2D UI is an orthographic camera.
The coordinate point of the UI root in the 3D UI is at a point in the three-dimensional space, which is automatically defined when the UI is created, and the UI controls that are created at a later time are automatically generated on the face of that point (automatically unifying to the z axis of the UI root)
Note: If you need to change the 3D UI to a three-dimensional UI, instead of simply changing the camera to perspective mode, in some versions after Ngui 3.6.0, this will cause you to not see any UI controls (these versions of the 2D UI and camera, UI root are on the same z-axis, Instead of being seen with the camera's z-axis when it becomes a 3D camera, if you change the camera of the X-UI directly to orthogonal mode, it doesn't simply turn into a 2D UI, so the size of the orthogonal camera is not the same as the default value of Ngui.
How to determine which UI to choose
1. The new version of Ngui is good for the 3D UI, and if the 3D UI and 2D UI are selected, it is recommended to choose the 3D UI for greater extensibility.
2. You must select the 2D UI if the UI does not allow for size changes from near and far perspectives.
3. If you want the UI to have a three-dimensional transformation effect, you must use the 3D UI.
4. It is recommended that you choose a 3D UI if you cannot clearly know which UI to apply.
5. No matter what kind of UI, it is essentially a camera difference, basically can achieve the UI effect, just need to deal with different.
How the UI and 3D UI work