Build a Main Menu in Unity
Objective: Build a menu that scales with screen.
When building out menu in a game we have to keep in mind the devices that may have a game played on. One thing to prepare for that is to make sure the UI images and buttons always stay on screen. Today we will discuss how to do that.
First thing we do is create a image.
The First thing we will do is select Canvas and under Canvas Scaler, UI Scale Mode, set as Scale with screen size.
Now back on the Image we will verify that it is anchored to the center.
Now we can add more images under this one to keep them grouped together and they will stay in the center of the screen.
For the text, it is placed under the white block in the hierarchy to always stay with the white block.
Now we need an image to be able to close the Menu. We’ll create another image under the canvas.
We would want this image to stay in the corner at all times. To do this we will set the Anchor’s and position there. If you select the Anchor Presets and hold Shift and Alt and select where you want it to be placed and anchored at.
The Image should be in the top right corner. Based off what I did above.
With that we have our images stay in that location and will scale with any screen it goes on. Thank you for reading and have a wonderful day!