Version: 2022.1
Create and manage UI Documents (UXML)
Runtime UI vs Editor Extension Authoring

Set up the Canvas

Canvas
Canvas

Within the ViewportThe user’s visible area of an app on their screen.
See in Glossary
pane, you can find the Canvas, a floating re-sizable edit-time container that contains a live version of the UI(User Interface) Allows a user to interact with your application. Unity currently supports three UI systems. More info
See in Glossary
Document (UXML). If you can’t see it, select the Fit Canvas button in the Viewport toolbarA row of buttons and basic controls at the top of the Unity Editor that allows you to interact with the Editor in various ways (e.g. scaling, translation). More info
See in Glossary
to bring it into view. Any settings related to the Canvas, like its size, aren’t saved as part of the UI Document (UXML) but stored in a separate settings file for the next time you open the same UI Document (UXML).

Size the Canvas

To resize the Canvas inside the Viewport, drag the edges or corners. For exact sizing, click on the header of the Canvas through the InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
See in Glossary
pane, where you will see fields for Canvas height and width. You can also lock the Canvas size to the size of the Unity Game Window using the Match Game View checkbox to align with a runtime UI environment:

CanvasSizeSettings
CanvasSizeSettings

Change Canvas background

You can change the Canvas background to make editing the UI in context easier. To change the background, select the Canvas in the Inspector pane. You can set it to be a solid color, a specific texture (a mock up from a UI Designer), or a live view from a CameraA component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
See in Glossary
in an open Unity SceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary
:

CanvasBackgroundSettings
CanvasBackgroundSettings
Create and manage UI Documents (UXML)
Runtime UI vs Editor Extension Authoring
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961