If the screen is resized or changes resolution, the Canvas will automatically change size to match this. This render mode places UI elements on the screen rendered on top of the scene.
The Canvas has a Render Mode setting which can be used to make it render in screen space or world space. More info See in Glossary: SetAsFirstSibling, SetAsLastSibling, and SetSiblingIndex. The order can also be controlled from scripting by using these methods on the Transform component A Transform component determines the Position, Rotation, and Scale of each object in the scene. To change which element appear on top of other elements, simply reorder the elements in the Hierarchy by dragging them. If two UI elements overlap, the later one will appear on top of the earlier one. The first child is drawn first, the second child next, and so on. UI elements in the Canvas are drawn in the same order they appear in the Hierarchy. This makes it easy to position UI elements without needing to have the Game View visible at all times.Ĭanvas uses the EventSystem object to help the Messaging System. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. Think of each unique Scene file as a unique level. The Canvas area is shown as a rectangle in the Scene A Scene contains the environments and menus of your game. The UI element is created as a child to this Canvas. The Canvas is a Game Object with a Canvas component on it, and all UI elements must be children of such a Canvas.Ĭreating a new UI element, such as an Image using the menu GameObject > UI > Image, automatically creates a Canvas, if there isn’t already a Canvas in the scene. More info See in Glossary elements should be inside. The Canvas is the area that all UI (User Interface) Allows a user to interact with your application.