Open 3D Engine LyShine Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
ILyShine Class Referenceabstract

The ILyShine interface provides access to the other interfaces provided by the UI module. More...

#include <ILyShine.h>

Inherited by CLyShine.

Public Member Functions

 AZ_RTTI (ILyShine, "{652ED9D7-0782-44E8-BCE7-65DD38C90907}")
 
virtual void Release ()=0
 Delete this object.
 
virtual IDraw2dGetDraw2d ()=0
 Gets the IDraw2d interface.
 
virtual AZ::EntityId CreateCanvas ()=0
 Create an empty UI Canvas (in game)
 
virtual AZ::EntityId LoadCanvas (const AZStd::string &assetIdPathname)=0
 Load a UI Canvas from in-game.
 
virtual AZ::EntityId CreateCanvasInEditor (UiEntityContext *entityContext)=0
 Create an empty UI Canvas (for the UI editor)
 
virtual AZ::EntityId LoadCanvasInEditor (const AZStd::string &assetIdPathname, const AZStd::string &sourceAssetPathname, UiEntityContext *entityContext)=0
 Load a UI Canvas from the UI editor.
 
virtual AZ::EntityId ReloadCanvasFromXml (const AZStd::string &xmlString, UiEntityContext *entityContext)=0
 Reload a UI Canvas from xml. For use in the editor for the undo system only.
 
virtual AZ::EntityId FindCanvasById (LyShine::CanvasId id)=0
 
virtual AZ::EntityId FindLoadedCanvasByPathName (const AZStd::string &assetIdPathname)=0
 
virtual void ReleaseCanvas (AZ::EntityId canvas, bool forEditor=false)=0
 Release a canvas from use either in-game or in editor, destroy UI Canvas if no longer used in either.
 
virtual void ReleaseCanvasDeferred (AZ::EntityId canvas)=0
 Queue a canvas for release on the next tick (used in game mode)
 
virtual ISpriteLoadSprite (const AZStd::string &pathname)=0
 Load a sprite object.
 
virtual ISpriteCreateSprite (const AZ::Data::Asset< AZ::RPI::AttachmentImageAsset > &attachmentImageAsset)=0
 Create a sprite that references the specified render target asset.
 
virtual bool DoesSpriteTextureAssetExist (const AZStd::string &pathname)=0
 Check if a sprite's texture asset exists. The .sprite sidecar file is optional and is not checked.
 
virtual AZ::Data::Instance< AZ::RPI::Image > LoadTexture (const AZStd::string &pathName)=0
 Load an image asset by texture pathname.
 
virtual void PostInit ()=0
 Perform post-initialization (script system will be available)
 
virtual void SetViewportSize (AZ::Vector2 viewportSize)=0
 Set the current viewport size, this should be called before Update and Render are called.
 
virtual void Update (float deltaTimeInSeconds)=0
 
virtual void Render ()=0
 Render 2D and UI elements that should be rendered at end of frame.
 
virtual void ExecuteQueuedEvents ()=0
 Execute events that were queued during a canvas update or input event handler.
 
virtual void Reset ()=0
 Reset the system (this happens at end of running game in Editor for example)
 
virtual void OnLevelUnload ()=0
 Unload canvases that should be unloaded when a level is unloaded.
 
virtual void OnLoadScreenUnloaded ()=0
 

Detailed Description

The ILyShine interface provides access to the other interfaces provided by the UI module.

Member Function Documentation

◆ CreateCanvas()

virtual AZ::EntityId ILyShine::CreateCanvas ( )
pure virtual

Create an empty UI Canvas (in game)

The system keeps track of all the loaded canvases and unloads them on game exit.

Implemented in CLyShine.

◆ CreateCanvasInEditor()

virtual AZ::EntityId ILyShine::CreateCanvasInEditor ( UiEntityContext entityContext)
pure virtual

Create an empty UI Canvas (for the UI editor)

The editor keeps track of the canvases it has open.

Implemented in CLyShine.

◆ CreateSprite()

virtual ISprite * ILyShine::CreateSprite ( const AZ::Data::Asset< AZ::RPI::AttachmentImageAsset > &  attachmentImageAsset)
pure virtual

Create a sprite that references the specified render target asset.

Implemented in CLyShine.

◆ DoesSpriteTextureAssetExist()

virtual bool ILyShine::DoesSpriteTextureAssetExist ( const AZStd::string &  pathname)
pure virtual

Check if a sprite's texture asset exists. The .sprite sidecar file is optional and is not checked.

Implemented in CLyShine.

◆ ExecuteQueuedEvents()

virtual void ILyShine::ExecuteQueuedEvents ( )
pure virtual

Execute events that were queued during a canvas update or input event handler.

Implemented in CLyShine.

◆ FindCanvasById()

virtual AZ::EntityId ILyShine::FindCanvasById ( LyShine::CanvasId  id)
pure virtual

Get a loaded canvas by CanvasId NOTE: this only searches canvases loaded in the game (not the editor)

Implemented in CLyShine.

◆ FindLoadedCanvasByPathName()

virtual AZ::EntityId ILyShine::FindLoadedCanvasByPathName ( const AZStd::string &  assetIdPathname)
pure virtual

Get a loaded canvas by path name NOTE: this only searches canvases loaded in the game (not the editor)

Implemented in CLyShine.

◆ GetDraw2d()

virtual IDraw2d * ILyShine::GetDraw2d ( )
pure virtual

Gets the IDraw2d interface.

Implemented in CLyShine.

◆ LoadCanvas()

virtual AZ::EntityId ILyShine::LoadCanvas ( const AZStd::string &  assetIdPathname)
pure virtual

Load a UI Canvas from in-game.

Implemented in CLyShine.

◆ LoadCanvasInEditor()

virtual AZ::EntityId ILyShine::LoadCanvasInEditor ( const AZStd::string &  assetIdPathname,
const AZStd::string &  sourceAssetPathname,
UiEntityContext entityContext 
)
pure virtual

Load a UI Canvas from the UI editor.

Implemented in CLyShine.

◆ LoadSprite()

virtual ISprite * ILyShine::LoadSprite ( const AZStd::string &  pathname)
pure virtual

Load a sprite object.

Implemented in CLyShine.

◆ LoadTexture()

virtual AZ::Data::Instance< AZ::RPI::Image > ILyShine::LoadTexture ( const AZStd::string &  pathName)
pure virtual

Load an image asset by texture pathname.

Implemented in CLyShine.

◆ OnLevelUnload()

virtual void ILyShine::OnLevelUnload ( )
pure virtual

Unload canvases that should be unloaded when a level is unloaded.

Implemented in CLyShine.

◆ OnLoadScreenUnloaded()

virtual void ILyShine::OnLoadScreenUnloaded ( )
pure virtual

Called when a load screen is finished displaying (when a level load is complete). Used to mark all render graphs dirty in case the loaded canvases were already rendered before their textures were done loading. This happens when a load screen is being rendered during a level load. When other canvases associated with the level are loaded, they also get rendered by the UiLoadScreenComponent, but their texture loading is delayed until further down the level load process. Once a canvas is rendered, its render graph's dirty flag is cleared, so the render graph needs to be marked dirty again after the textures are loaded

Implemented in CLyShine.

◆ PostInit()

virtual void ILyShine::PostInit ( )
pure virtual

Perform post-initialization (script system will be available)

Implemented in CLyShine.

◆ Release()

virtual void ILyShine::Release ( )
pure virtual

Delete this object.

Implemented in CLyShine.

◆ ReleaseCanvas()

virtual void ILyShine::ReleaseCanvas ( AZ::EntityId  canvas,
bool  forEditor = false 
)
pure virtual

Release a canvas from use either in-game or in editor, destroy UI Canvas if no longer used in either.

Implemented in CLyShine.

◆ ReleaseCanvasDeferred()

virtual void ILyShine::ReleaseCanvasDeferred ( AZ::EntityId  canvas)
pure virtual

Queue a canvas for release on the next tick (used in game mode)

Implemented in CLyShine.

◆ ReloadCanvasFromXml()

virtual AZ::EntityId ILyShine::ReloadCanvasFromXml ( const AZStd::string &  xmlString,
UiEntityContext entityContext 
)
pure virtual

Reload a UI Canvas from xml. For use in the editor for the undo system only.

Implemented in CLyShine.

◆ Render()

virtual void ILyShine::Render ( )
pure virtual

Render 2D and UI elements that should be rendered at end of frame.

Implemented in CLyShine.

◆ Reset()

virtual void ILyShine::Reset ( )
pure virtual

Reset the system (this happens at end of running game in Editor for example)

Implemented in CLyShine.

◆ SetViewportSize()

virtual void ILyShine::SetViewportSize ( AZ::Vector2  viewportSize)
pure virtual

Set the current viewport size, this should be called before Update and Render are called.

Implemented in CLyShine.

◆ Update()

virtual void ILyShine::Update ( float  deltaTimeInSeconds)
pure virtual

Update UI elements

Parameters
deltaTimeInSecondsthe amount of time in seconds since the last call to this function

Implemented in CLyShine.


The documentation for this class was generated from the following file: