Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tutorial] Create a 9:16 game aspect ratio in Unity to let the UI showing correctly #14

Open
mmmmmm44 opened this issue May 16, 2022 · 0 comments
Labels
good first issue Good for newcomers

Comments

@mmmmmm44
Copy link
Owner

Thank you for your interest about this project. I did not expect that much attention on YouTube in last year when I uploaded.

###Background

I changed the game running aspect ratio from a landscape 4:3 to a portrait 9:16 in the view of showing the full body of the model. This is common in vtuber capturing software running on mobile, and for streamer to slowly revealing their new outfits from toe to head.

Moreover, I adjusted the UI panels optimally for this aspect ratio. Yet Unity does not come with this aspect ratio by default. Luckily, the changes are simple and with a few steps you can get a nice-looking UI.

###Steps

Here I am using the UnityChan project as a demo. The procedure is applicable to the Live2D unity project.

  1. After importing a package, your UI should look like this, with widgets, buttons leaving their ideal position.

game_ui_ratio_setting_0

  1. Click the aspect ratio area. A drop-down menu should be shown.

game_ui_ratio_setting_1

  1. Click the "+" button at the bottom of the drop-down menu

game_ui_ratio_setting_2

  1. A menu is shown for you to input the custom 9:16 aspect ratio. Following the picture bellow to input them. Press "OK".

game_ui_ratio_setting_3

  1. Apply the newly input aspect ratio and you can see the UI components are back to their right position.

game_ui_ratio_setting_4

###Add-ons

If you feel uncomfortable with the UI, or want to adjust the height of each columns for landscape 4:3 display, or whether reason, the height of each columns can be adjusted in each of the panel, namely "Setting Panel" (child of "Character Setting Canvas"), and "TCP Panel". There is a script namely "AdjustGridLayoutCellSize" attached. Inside the script there is a parameter called "Cell Ratio". Adjust the value to increase/ decrease the height of the columns.

(Hint: the meaning is height = width of the panel (Cell size X of Grid Layout Group) * "Cell Ratio")

game_ui_ratio_setting_5

Thank you for your interest on this project.

I hope you can enjoy this project.

mmmmmm44

@mmmmmm44 mmmmmm44 added the good first issue Good for newcomers label May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant