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.
UiEntityContext Class Referenceabstract

#include <UiEntityContext.h>

Inherits AzFramework::EntityContext, and UiEntityContextRequestBus::Handler.

Inherited by UiEditorEntityContext, and UiGameEntityContext.

Public Member Functions

virtual void InitUiContext ()=0
 Initialize the entity context and instantiate the root slice.
 
virtual void DestroyUiContext ()=0
 Destroy the Entity Context.
 
virtual bool SaveToStreamForGame (AZ::IO::GenericStream &stream, AZ::DataStream::StreamType streamType)=0
 
virtual bool SaveCanvasEntityToStreamForGame (AZ::Entity *canvasEntity, AZ::IO::GenericStream &stream, AZ::DataStream::StreamType streamType)=0
 

Detailed Description

The UI Entity Context stores the prefab asset for the root slice of a UI canvas So all of the UI element entities in a canvas are owned indirectly by the context and managed by the entity context.

Member Function Documentation

◆ SaveCanvasEntityToStreamForGame()

virtual bool UiEntityContext::SaveCanvasEntityToStreamForGame ( AZ::Entity *  canvasEntity,
AZ::IO::GenericStream &  stream,
AZ::DataStream::StreamType  streamType 
)
pure virtual

Saves the given canvas entity to the specified buffer. If necessary the entity undergoes conversion for game: editor -> game components.

Returns
true if successfully saved. Failure is only possible if serialization data is corrupt. This is needed because the canvas entity is not part of the root slice. It is here in the entity context because that allows us to get to the ToolsFramework functionality.

Implemented in UiGameEntityContext, and UiEditorEntityContext.

◆ SaveToStreamForGame()

virtual bool UiEntityContext::SaveToStreamForGame ( AZ::IO::GenericStream &  stream,
AZ::DataStream::StreamType  streamType 
)
pure virtual

Saves the context's slice root to the specified buffer. If necessary entities undergo conversion for game: editor -> game components.

Returns
true if successfully saved. Failure is only possible if serialization data is corrupt.

Implemented in UiGameEntityContext, and UiEditorEntityContext.


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