Setting up the UI Canvas
Mobile devices come in many different screen sizes and resolutions. In ZEPETO World, Unity's Canvas is used to express UI elements, so Unity has the same limitations.
The following guide provides a neutral set-up to present your UI for as many devices as possible.
Therefore, although it is not possible to express a UI that fits exactly on all mobile devices, we aim to place UI elements in similar positions on most devices.
- UI Scale Mode : Scale With Scren Size
- Reference Resolution :
- X : 750
- Y : 1334
- Screen Match Mode : Match Width Or Height
- Match Width
- Create an object called SafeArea as a child of the Canvas object.
- In the Inspector panel, click the Add Component button to add the Zepeto Screen Safe Area component.
👍 Tips
- The Zepeto Screen Safe Area component moves the UI that is covered by the notch area and home bar of certain terminals to the inside of the screen on the IOS screen.
- UI objects affected by Zepeto Screen Safe Area can be included as sub-objects.
Set the button area on the upper right to automatically align left and right whenever elements are added as sub-objects through Layout Group.
Create a new object under SafeArea and set the following components.
- Rect Transform
- PosX : -22, PosY : -22
- Horizontal Layout Group
- Spacing: 20
- Child Alignment : Upper Left
- Content Size Filter
- Horizontal Fit : Preferred Size
Create a Button object as a child of the button area. The buttons are automatically aligned and apply the following settings.
- Width : 62
- Height : 62
Now, if you build the world and check it on your mobile device, you will see a button located in the upper right corner as shown in the following image.
❗️ Caution Since the left home button and chat button are buttons displayed in the native environment of the ZEPETO app, the exact location and size cannot be matched through Canvas.
In order to set UI elements in the left area of the screen, only a few changes in the right area set in Step-3 are required. Here are the settings you need to change.
- RectTransform
- PosX : 22, PosY : -22
- Horizontal Layout Group
- Spacing : 20
- Child Alignment : Upper Left
- UI Scale Mode : Scale With Screen Size
- Reference Resolution : X : 750, Y : 1334
- Screen Match Mode : Match Width Or Height
- Match Width
- Create an object called SafeArea as a child of the Canvas object.
- In the Inspector panel, click the Add Component button to add the Zepeto Screen Safe Area component.
👍 Tips
- The Zepeto Screen Safe Area component moves the UI that is covered by the notch area and home bar of certain terminals to the inside of the screen on the IOS screen.
- UI objects affected by Zepeto Screen Safe Area can be included as sub-objects.
Set the button area on the upper right to automatically align left and right whenever elements are added as sub-objects through Layout Group.
Create a new object under SafeArea and set the following components.
- Rect Transform
- PosX : -22, PosY : -22
- Horizontal Layout Group
- Spacing: 20
- Child Alignment : Upper Left
- Content Size Filter
- Horizontal Fit : Preferred Size
Create a Button object as a child of the button area. The buttons are automatically aligned and apply the following settings.
- Width : 62
- Height : 62
Now, if you build the world and check it on your mobile device, you will see a button located in the upper right corner as shown in the following image.
❗️ Caution Since the left home button and chat button are buttons displayed in the native environment of the ZEPETO app, the exact location and size cannot be matched through Canvas.
In order to set UI elements in the left area of the screen, only a few changes in the right area set in Step-3 are required. Here are the settings you need to change.
- RectTransform
- PosX : 22, PosY : -22
- Horizontal Layout Group
- Spacing : 20
- Child Alignment : Upper Left