This documentation is for a prerelease version of O3DE. Click here to switch to the latest release, or select a version from the dropdown.

Version:

UI Canvas Asset Ref Component

With the UI Canvas Asset Ref component, you can associate a UI canvas with an entity.

Usage

In the Canvas pathname property field, enter the name of a .uicanvas asset in your project. Then, select the canvas to associate with this component from the dropdown list that automatically populates. Alternatively, click the button and choose a .uicanvas asset from the file browser.

After you select a UI canvas you can set additional properties to load automatically and choose whether to load it in an enabled or disabled state.

Use UI Canvas Asset Ref nodes to reference the canvas in Script Canvas.

If you want to place a UI canvas on a 3D mesh that a user can interact with, use this component in conjunction with the UI Canvas on Mesh component. For more information, refer to Placing UI Canvases in the 3D World.

Provider

LyShine Gem

UI Canvas Asset Ref properties

UI Canvas Asset Ref properties

PropertyDescriptionValuesDefault
Canvas pathnameSelects the canvas asset to load..uicanvasNone
Load automaticallyIf enabled, the canvas will automatically load in an enabled state when this component activates.BooleanDisabled
Load in disabled stateIf enabled, the canvas will automatically load, but in a disabled state. The canvas must be enabled before it is visible.

This property is available only if Load automatically is set to Enabled.
BooleanDisabled

UiCanvasRefBus

Method NameDescriptionParameterReturnScriptable
GetCanvasReturns the name of the UI Canvas asset set in the Canvas pathname property.NoneName: StringYes

For more information, see Working with the Event Bus (EBus) system.