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. | |
IDraw2d * | GetDraw2d () override |
Gets the IDraw2d interface. | |
AZ::EntityId | CreateCanvas () override |
Create an empty UI Canvas (in game) | |
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) | |
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) | |
ISprite * | LoadSprite (const AZStd::string &pathname) override |
Load a sprite object. | |
ISprite * | CreateSprite (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 |
UiRenderer * | GetUiRenderer () |
UiRenderer * | GetUiRendererForEditor () |
void | SetUiRendererForEditor (AZStd::shared_ptr< UiRenderer > uiRenderer) |
Public Member Functions inherited from ILyShine | |
AZ_RTTI (ILyShine, "{652ED9D7-0782-44E8-BCE7-65DD38C90907}") | |
virtual void | Release ()=0 |
Delete this object. | |
virtual IDraw2d * | GetDraw2d ()=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 ISprite * | LoadSprite (const AZStd::string &pathname)=0 |
Load a sprite object. | |
virtual ISprite * | CreateSprite (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 |
Static Public Member Functions | |
static void | RunUnitTests (IConsoleCmdArgs *cmdArgs) |
|
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.
|
overridevirtual |
Create an empty UI Canvas (for the UI editor)
The editor keeps track of the canvases it has open.
Implements ILyShine.
|
overridevirtual |
Create a sprite that references the specified render target asset.
Implements ILyShine.
|
overridevirtual |
Check if a sprite's texture asset exists. The .sprite sidecar file is optional and is not checked.
Implements ILyShine.
|
overridevirtual |
Execute events that were queued during a canvas update or input event handler.
Implements ILyShine.
|
overridevirtual |
Get a loaded canvas by CanvasId NOTE: this only searches canvases loaded in the game (not the editor)
Implements ILyShine.
|
overridevirtual |
Get a loaded canvas by path name NOTE: this only searches canvases loaded in the game (not the editor)
Implements ILyShine.
|
overridevirtual |
Load a UI Canvas from in-game.
Implements ILyShine.
|
overridevirtual |
Load a UI Canvas from the UI editor.
Implements ILyShine.
|
overridevirtual |
Load a sprite object.
Implements ILyShine.
|
overridevirtual |
Load an image asset by texture pathname.
Implements ILyShine.
|
overridevirtual |
Unload canvases that should be unloaded when a level is unloaded.
Implements ILyShine.
|
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.
|
overridevirtual |
Perform post-initialization (script system will be available)
Implements ILyShine.
|
overridevirtual |
Delete this object.
Implements ILyShine.
|
overridevirtual |
Release a canvas from use either in-game or in editor, destroy UI Canvas if no longer used in either.
Implements ILyShine.
|
overridevirtual |
Queue a canvas for release on the next tick (used in game mode)
Implements ILyShine.
|
overridevirtual |
Reload a UI Canvas from xml. For use in the editor for the undo system only.
Implements ILyShine.
|
overridevirtual |
Render 2D and UI elements that should be rendered at end of frame.
Implements ILyShine.
|
overridevirtual |
Reset the system (this happens at end of running game in Editor for example)
Implements ILyShine.
|
overridevirtual |
Set the current viewport size, this should be called before Update and Render are called.
Implements ILyShine.
|
overridevirtual |
Update UI elements
deltaTimeInSeconds | the amount of time in seconds since the last call to this function |
Implements ILyShine.