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

CLyShine is the full implementation of the ILyShine interface. More...

#include <LyShine.h>

Inherits ILyShine, UiCursorBus::Handler, AzFramework::InputChannelEventListener, AzFramework::InputTextEventListener, AZ::TickBus::Handler, AZ::RPI::ViewportContextNotificationBus::Handler, AZ::Render::Bootstrap::NotificationBus::Handler, and LyShinePassDataRequestBus::Handler.

Public Member Functions

 CLyShine ()
 Create the LyShine object, the given system pointer is stored internally.
 
void Release () override
 Delete this object.
 
IDraw2dGetDraw2d () override
 Gets the IDraw2d interface.
 
AZ::EntityId CreateCanvas () override
 Create an empty UI Canvas (in game) More...
 
AZ::EntityId LoadCanvas (const AZStd::string &assetIdPathname) override
 Load a UI Canvas from in-game.
 
AZ::EntityId CreateCanvasInEditor (UiEntityContext *entityContext) override
 Create an empty UI Canvas (for the UI editor) More...
 
AZ::EntityId LoadCanvasInEditor (const AZStd::string &assetIdPathname, const AZStd::string &sourceAssetPathname, UiEntityContext *entityContext) override
 Load a UI Canvas from the UI editor.
 
AZ::EntityId ReloadCanvasFromXml (const AZStd::string &xmlString, UiEntityContext *entityContext) override
 Reload a UI Canvas from xml. For use in the editor for the undo system only.
 
AZ::EntityId FindCanvasById (LyShine::CanvasId id) override
 
AZ::EntityId FindLoadedCanvasByPathName (const AZStd::string &assetIdPathname) override
 
void ReleaseCanvas (AZ::EntityId canvas, bool forEditor) override
 Release a canvas from use either in-game or in editor, destroy UI Canvas if no longer used in either.
 
void ReleaseCanvasDeferred (AZ::EntityId canvas) override
 Queue a canvas for release on the next tick (used in game mode)
 
ISpriteLoadSprite (const AZStd::string &pathname) override
 Load a sprite object.
 
ISpriteCreateSprite (const AZ::Data::Asset< AZ::RPI::AttachmentImageAsset > &attachmentImageAsset) override
 Create a sprite that references the specified render target asset.
 
bool DoesSpriteTextureAssetExist (const AZStd::string &pathname) override
 Check if a sprite's texture asset exists. The .sprite sidecar file is optional and is not checked.
 
AZ::Data::Instance< AZ::RPI::Image > LoadTexture (const AZStd::string &pathname) override
 Load an image asset by texture pathname.
 
void PostInit () override
 Perform post-initialization (script system will be available)
 
void SetViewportSize (AZ::Vector2 viewportSize) override
 Set the current viewport size, this should be called before Update and Render are called.
 
void Update (float deltaTimeInSeconds) override
 
void Render () override
 Render 2D and UI elements that should be rendered at end of frame.
 
void ExecuteQueuedEvents () override
 Execute events that were queued during a canvas update or input event handler.
 
void Reset () override
 Reset the system (this happens at end of running game in Editor for example)
 
void OnLevelUnload () override
 Unload canvases that should be unloaded when a level is unloaded.
 
void OnLoadScreenUnloaded () override
 
void IncrementVisibleCounter () override
 
void DecrementVisibleCounter () override
 
bool IsUiCursorVisible () override
 
void SetUiCursor (const char *cursorImagePath) override
 
AZ::Vector2 GetUiCursorPosition () override
 
void SetUiCursorPosition (const AZ::Vector2 &) override
 
bool OnInputChannelEventFiltered (const AzFramework::InputChannel &inputChannel) override
 
bool OnInputTextEventFiltered (const AZStd::string &textUTF8) override
 
void OnTick (float deltaTime, AZ::ScriptTimePoint time) override
 
int GetTickOrder () override
 
void OnRenderTick () override
 
void OnBootstrapSceneReady (AZ::RPI::Scene *bootstrapScene) override
 
LyShine::AttachmentImagesAndDependencies GetRenderTargets () override
 
UiRendererGetUiRenderer ()
 
UiRendererGetUiRendererForEditor ()
 
void SetUiRendererForEditor (AZStd::shared_ptr< UiRenderer > uiRenderer)
 
- Public Member Functions inherited from ILyShine
 AZ_RTTI (ILyShine, "{652ED9D7-0782-44E8-BCE7-65DD38C90907}")
 

Static Public Member Functions

static void RunUnitTests (IConsoleCmdArgs *cmdArgs)
 

Detailed Description

CLyShine is the full implementation of the ILyShine interface.

Member Function Documentation

◆ CreateCanvas()

AZ::EntityId CLyShine::CreateCanvas ( )
overridevirtual

Create an empty UI Canvas (in game)

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

Implements ILyShine.

◆ CreateCanvasInEditor()

AZ::EntityId CLyShine::CreateCanvasInEditor ( UiEntityContext entityContext)
overridevirtual

Create an empty UI Canvas (for the UI editor)

The editor keeps track of the canvases it has open.

Implements ILyShine.

◆ FindCanvasById()

AZ::EntityId CLyShine::FindCanvasById ( LyShine::CanvasId  id)
overridevirtual

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

Implements ILyShine.

◆ FindLoadedCanvasByPathName()

AZ::EntityId CLyShine::FindLoadedCanvasByPathName ( const AZStd::string &  assetIdPathname)
overridevirtual

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

Implements ILyShine.

◆ OnLoadScreenUnloaded()

void CLyShine::OnLoadScreenUnloaded ( )
overridevirtual

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

Implements ILyShine.

◆ Update()

void CLyShine::Update ( float  deltaTimeInSeconds)
overridevirtual

Update UI elements

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

Implements ILyShine.


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