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

Inherits UiInteractableStatesBus::Handler.

Public Types

using StateActions = AZStd::vector< UiInteractableStateAction * >
 

Public Member Functions

void SetStateColor (UiInteractableStatesInterface::State state, AZ::EntityId target, const AZ::Color &color) override
 
AZ::Color GetStateColor (State state, AZ::EntityId target) override
 
bool HasStateColor (UiInteractableStatesInterface::State state, AZ::EntityId target) override
 
void SetStateAlpha (UiInteractableStatesInterface::State state, AZ::EntityId target, float alpha) override
 
float GetStateAlpha (State state, AZ::EntityId target) override
 
bool HasStateAlpha (UiInteractableStatesInterface::State state, AZ::EntityId target) override
 
void SetStateSprite (UiInteractableStatesInterface::State state, AZ::EntityId target, ISprite *sprite) override
 
ISpriteGetStateSprite (UiInteractableStatesInterface::State state, AZ::EntityId target) override
 
void SetStateSpritePathname (State state, AZ::EntityId target, const AZStd::string &spritePath) override
 
AZStd::string GetStateSpritePathname (State state, AZ::EntityId target) override
 
bool HasStateSprite (UiInteractableStatesInterface::State state, AZ::EntityId target) override
 
void SetStateFont (State state, AZ::EntityId target, const AZStd::string &fontPathname, unsigned int fontEffectIndex) override
 
AZStd::string GetStateFontPathname (State state, AZ::EntityId target) override
 
unsigned int GetStateFontEffectIndex (State state, AZ::EntityId target) override
 
bool HasStateFont (State state, AZ::EntityId target) override
 
void Init (AZ::EntityId entityId)
 Initialize the manager.
 
void Activate ()
 Connect to the bus.
 
void Deactivate ()
 Disconnect from the bus.
 
void AddState (StateActions *stateActions)
 Use this to add the the state actions for a state. This should be done at initialization time.
 
void ResetAllOverrides ()
 Reset thes on all visual components being affected by the state actions on all states.
 
void ApplyStateActions (int state)
 Apply the StateActions for the given state. This will apply any specifieds to the visual components.
 
void InitInteractableEntityForStateActions (StateActions &stateActions)
 
void ClearStates ()
 Remove all the states after deleting each StateAction.
 

Protected Member Functions

void InitStateActions ()
 Do any initialization of state actions required after load.
 
AZStd::vector< AZ::EntityId > GetTargetEntitiesInAllStates ()
 Get a list of all entities that appear as target entities in all of the lists of StateActions.
 
StateActions * GetStateActions (int state)
 Get the state actions for a given state.
 
template<typename T >
T * GetStateAction (int state, AZ::EntityId target)
 

Protected Attributes

AZ::EntityId m_entityId
 
AZStd::vector< StateActions * > m_states
 

Member Function Documentation

◆ GetStateAction()

template<typename T >
T * UiStateActionManager::GetStateAction ( int  state,
AZ::EntityId  target 
)
inlineprotected

Get the derived class of UiInteractableStateAction for a given state/target and derived class type (if it exists) e.g. StateColor* stateColor = GetStateAction<UiInteractableStateColor>(UiInteractableStatesInterface::StateColor, target); This will return null if no such state action exists.

◆ InitInteractableEntityForStateActions()

void UiStateActionManager::InitInteractableEntityForStateActions ( StateActions &  stateActions)

Whenever a new StateAction is added in the editor we need to initialize the target entity to the owning entity.


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