UI Elements in Unity
UI is the elevation of any project. It provides abilities to access properties and if designed correctly, the interface makes the whole process butter smooth.
In Unity, there is a dedicated section of options for building UI game objects. It covers all types of UI components that are needed in a game.
When you select an object from this drop-down menu, Unity also delivers two foundational entities that support UI functions.
A canvas and an event handler. The canvas holds multiple UI components and makes them responsive to screen size changes whereas the event handler is a listener object that reacts according to selections/Inputs.
This is how a canvas looks in Unity.
Let us explore a few configurations.
- This is where the text component is seating on canvas. I’d like to put it up in the top-right corner where it suits the most.
- This is how the end result looks. Let us make use of canvas and make this element screen responsive so that when the game screen shrinks, the text element also shrinks its size.
In the same way, we saw a text element, one could implement any available UI element from the menu and do wonderful things on the canvas.
Thank you very much