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

Inherits AZ::Component, UiTooltipDisplayBus::Handler, UiInitializationBus::Handler, and IUiAnimationListener.

Public Types

enum class  State {
  Hiding , Hidden , DelayBeforeShow , Showing ,
  Shown
}
 
using EntityComboBoxVec = AZStd::vector< AZStd::pair< AZ::EntityId, AZStd::string > >
 
using SequenceComboBoxVec = AZStd::vector< AZStd::string >
 
- Public Types inherited from IUiAnimationListener
enum  EUiAnimationEvent { eUiAnimationEvent_Started = 0 , eUiAnimationEvent_Stopped , eUiAnimationEvent_Aborted , eUiAnimationEvent_Updated }
 

Public Member Functions

 AZ_COMPONENT (UiTooltipDisplayComponent, LyShine::UiTooltipDisplayComponentUuid, AZ::Component)
 
TriggerMode GetTriggerMode () override
 
void SetTriggerMode (TriggerMode triggerMode) override
 
bool GetAutoPosition () override
 
void SetAutoPosition (bool autoPosition) override
 
AutoPositionMode GetAutoPositionMode () override
 
void SetAutoPositionMode (AutoPositionMode autoPositionMode) override
 
const AZ::Vector2 & GetOffset () override
 
void SetOffset (const AZ::Vector2 &offset) override
 
bool GetAutoSize () override
 
void SetAutoSize (bool autoSize) override
 
AZ::EntityId GetTextEntity () override
 
void SetTextEntity (AZ::EntityId textEntity) override
 
float GetDelayTime () override
 
void SetDelayTime (float delayTime) override
 
float GetDisplayTime () override
 
void SetDisplayTime (float displayTime) override
 
void PrepareToShow (AZ::EntityId tooltipElement) override
 
void Hide () override
 
void Update () override
 
void InGamePostActivate () override
 
void OnUiAnimationEvent (EUiAnimationEvent uiAnimationEvent, IUiAnimSequence *pAnimSequence) override
 IUiAnimationListener.
 
State GetState ()
 
- Public Member Functions inherited from IUiAnimationListener
virtual void OnUiAnimationEvent (EUiAnimationEvent uiAnimationEvent, IUiAnimSequence *pAnimSequence)=0
 callback on UI animation events
 
virtual void OnUiTrackEvent (AZStd::string eventName, AZStd::string valueName, IUiAnimSequence *pAnimSequence)
 

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 Activate () override
 
void Deactivate () override
 
 AZ_DISABLE_COPY_MOVE (UiTooltipDisplayComponent)
 
void SetState (State state)
 Set the current state of the tooltip.
 
void EndTransitionState ()
 Skip to the next state if the current state is a transitional one.
 
void Show ()
 Show the display element.
 
void AutoResize ()
 
void ResizeElementByDelta (AZ::EntityId entityId, const AZ::Vector2 &delta)
 Resize an element by a specified delta.
 
void AutoPosition ()
 Position the display element according to the positioning mode.
 
void MoveToPosition (const AZ::Vector2 &point, const AZ::Vector2 &offsetFromPoint)
 Move the display element to a specified position.
 
void CheckBoundsAndChangeYPosition (const UiTransformInterface::Rect &boundsRect, float yPoint, float yOffsetFromPoint)
 
void ConstrainToBounds (const UiTransformInterface::Rect &boundsRect)
 Constrain the display element to a bounding rect.
 
UiTransformInterface::Rect GetAxisAlignedRect ()
 Get the axis aligned rect of the display element.
 
IUiAnimationSystemGetAnimationSystem ()
 Get the canvas's animation system.
 
IUiAnimSequenceGetSequence (const AZStd::string &sequenceName, IUiAnimationSystem *&animSystemOut)
 Get a sequence that is owned by the canvas's animation system.
 
void PrepareSequenceForPlay (const AZStd::string &sequenceName, IUiAnimSequence *&sequence, IUiAnimationSystem *&animSystemOut)
 Initialize the sequence before playing.
 
EntityComboBoxVec PopulateTextEntityList ()
 
SequenceComboBoxVec PopulateSequenceList ()
 

Protected Attributes

TriggerMode m_triggerMode
 
bool m_autoPosition
 
AutoPositionMode m_autoPositionMode
 
AZ::Vector2 m_offset
 
AZ::EntityId m_textEntity
 
bool m_autoSize
 
float m_delayTime
 
float m_displayTime
 
AZStd::string m_showSequenceName
 
AZStd::string m_hideSequenceName
 
State m_state
 
float m_stateStartTime
 
float m_curDelayTime
 
float m_timeSinceLastShown
 
AZ::EntityId m_tooltipElement
 
float m_maxWrapTextWidth
 
IUiAnimSequencem_showSequence
 
IUiAnimSequencem_hideSequence
 
bool m_listeningForAnimationEvents = false
 

Member Function Documentation

◆ AutoResize()

void UiTooltipDisplayComponent::AutoResize ( )
protected

Resize the display element so that its child text element is the same size as the text string. The text element's anchors are assumed to be set up so that the text element grows/shrinks with its parent.

◆ CheckBoundsAndChangeYPosition()

void UiTooltipDisplayComponent::CheckBoundsAndChangeYPosition ( const UiTransformInterface::Rect boundsRect,
float  yPoint,
float  yOffsetFromPoint 
)
protected

Change the vertical position of the display element if it exceeds a bounding rect. If the element exceeds the top of the rect, move it so that its top is a certain distance below the specified point. If the element exceeds the bottom of the rect, move it so that its bottom is a certain distance above the specified point.

◆ OnUiAnimationEvent()

void UiTooltipDisplayComponent::OnUiAnimationEvent ( EUiAnimationEvent  uiAnimationEvent,
IUiAnimSequence pAnimSequence 
)
overridevirtual

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