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.
UiImageComponent Class Reference

Inherits AZ::Component, UiVisualBus::Handler, UiRenderBus::Handler, UiImageBus::Handler, UiAnimateEntityBus::Handler, UiTransformChangeNotificationBus::Handler, UiLayoutCellDefaultBus::Handler, UiCanvasPixelAlignmentNotificationBus::Handler, UiSpriteSettingsChangeNotificationBus::Handler, and UiIndexableImageBus::Handler.

Public Member Functions

 AZ_COMPONENT (UiImageComponent, LyShine::UiImageComponentUuid, AZ::Component)
 
void ResetOverrides () override
 
void SetOverrideColor (const AZ::Color &color) override
 
void SetOverrideAlpha (float alpha) override
 
void SetOverrideSprite (ISprite *sprite, AZ::u32 cellIndex=0) override
 
void Render (LyShine::IRenderGraph *renderGraph) override
 
AZ::Color GetColor () override
 
void SetColor (const AZ::Color &color) override
 
float GetAlpha () override
 
void SetAlpha (float alpha) override
 
ISpriteGetSprite () override
 
void SetSprite (ISprite *sprite) override
 
AZStd::string GetSpritePathname () override
 
void SetSpritePathname (AZStd::string spritePath) override
 
bool SetSpritePathnameIfExists (AZStd::string spritePath) override
 
AZ::Data::Asset< AZ::RPI::AttachmentImageAsset > GetAttachmentImageAsset () override
 
void SetAttachmentImageAsset (const AZ::Data::Asset< AZ::RPI::AttachmentImageAsset > &attachmentImageAsset) override
 
bool GetIsRenderTargetSRGB () override
 
void SetIsRenderTargetSRGB (bool isSRGB) override
 
SpriteType GetSpriteType () override
 
void SetSpriteType (SpriteType spriteType) override
 
ImageType GetImageType () override
 
void SetImageType (ImageType imageType) override
 
FillType GetFillType () override
 
void SetFillType (FillType fillType) override
 
float GetFillAmount () override
 
void SetFillAmount (float fillAmount) override
 
float GetRadialFillStartAngle () override
 
void SetRadialFillStartAngle (float radialFillStartAngle) override
 
FillCornerOrigin GetCornerFillOrigin () override
 
void SetCornerFillOrigin (FillCornerOrigin cornerOrigin) override
 
FillEdgeOrigin GetEdgeFillOrigin () override
 
void SetEdgeFillOrigin (FillEdgeOrigin edgeOrigin) override
 
bool GetFillClockwise () override
 
void SetFillClockwise (bool fillClockwise) override
 
bool GetFillCenter () override
 
void SetFillCenter (bool fillCenter) override
 
void SetImageIndex (AZ::u32 index) override
 
const AZ::u32 GetImageIndex () override
 
const AZ::u32 GetImageIndexCount () override
 
AZStd::string GetImageIndexAlias (AZ::u32 index) override
 
void SetImageIndexAlias (AZ::u32 index, const AZStd::string &alias) override
 
AZ::u32 GetImageIndexFromAlias (const AZStd::string &alias) override
 
void PropertyValuesChanged () override
 
void OnCanvasSpaceRectChanged (AZ::EntityId entityId, const UiTransformInterface::Rect &oldRect, const UiTransformInterface::Rect &newRect) override
 
void OnTransformToViewportChanged () override
 
float GetMinWidth () override
 
float GetMinHeight () override
 
float GetTargetWidth (float maxWidth) override
 
float GetTargetHeight (float maxHeight) override
 
float GetExtraWidthRatio () override
 
float GetExtraHeightRatio () override
 
void OnCanvasPixelAlignmentChange () override
 
void OnSpriteSettingsChanged () override
 

Static Public Member Functions

static void GetProvidedServices (AZ::ComponentDescriptor::DependencyArrayType &provided)
 
static void GetIncompatibleServices (AZ::ComponentDescriptor::DependencyArrayType &incompatible)
 
static void GetRequiredServices (AZ::ComponentDescriptor::DependencyArrayType &required)
 
static void Reflect (AZ::ReflectContext *context)
 

Protected Member Functions

void Init () override
 
void Activate () override
 
void Deactivate () override
 
void ResetSpriteSheetCellIndex ()
 

Member Function Documentation

◆ ResetSpriteSheetCellIndex()

void UiImageComponent::ResetSpriteSheetCellIndex ( )
protected

Resets the current sprite-sheet cell index based on whether we're showing a sprite or a sprite-sheet.

This is necessary since the render routines reference the sprite-sheet cell index regardless of whether a sprite-sheet is being displayed or not. It's possible to have a sprite-sheet asset loaded but the image component sprite type be a basic sprite. In that case, indexing the sprite-sheet is still technically possible, so we assign a special index (-1) to indicate not to index a particular cell, but rather the whole image.


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