Class Canvas
A Canvas is a VisualElement that can be used to group other VisualElements. You can use it to create a scrollable area inside a window.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: solution.dll
Syntax
public class Canvas : VisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyleConstructors
| Name | Description | 
|---|---|
| Canvas() | Instantiates a Canvas element. | 
Fields
| Name | Description | 
|---|---|
| backgroundUssClassName | USS class name of the background element of this type. | 
| horizontalScrollerUssClassName | USS class name of the horizontal scroller element of this type. | 
| ussClassName | USS class name of elements of this type. | 
| verticalScrollerUssClassName | USS class name of the vertical scroller element of this type. | 
| viewportContainerUssClassName | USS class name of the viewport container element of this type. | 
| viewportUssClassName | USS class name of the viewport element of this type. | 
Properties
| Name | Description | 
|---|---|
| contentContainer | The content container of the Canvas. | 
| controlScheme | The current control scheme of the canvas. | 
| frameContainer | The container used for framing the Canvas. | 
| frameMargin | The margin applied when framing the Canvas. | 
| grabMode | The current grab state of the canvas (to pan). | 
| maxZoom | The maximum zoom factor of the Canvas. | 
| minZoom | The minimum zoom factor of the Canvas. | 
| panMultiplier | The pan multiplier when Shift key is hold. | 
| primaryManipulator | The current manipulator of the canvas for the primary pointer without modifier. | 
| scrollDirection | The scroll direction of the Canvas. See ScrollDirection for more information. | 
| scrollOffset | The scroll coordinates of the Canvas. | 
| scrollSpeed | The scroll speed of the Canvas. | 
| useSpaceBar | Whether the Canvas should use the Space bar to pan. | 
| zoom | The zoom factor of the Canvas. | 
| zoomMultiplier | The zoom speed multiplier when Shift key is hold. | 
| zoomSpeed | The zoom speed of the Canvas. | 
Methods
| Name | Description | 
|---|---|
| FrameAll() | Frame the Canvas to see all elements. | 
| FrameArea(Rect) | Frame the Canvas to the given area. The area is in the Viewport's local coordinates. | 
| FrameElement(VisualElement) | Frame the Canvas to the given element. The element is in the Viewport's local coordinates. | 
| FrameWorldRect(Rect) | Frame the Canvas to the given world area. The area is in world coordinates. |