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

Inherits AZ::Component, UiTransformBus::Handler, UiTransform2dBus::Handler, and UiAnimateEntityBus::Handler.

Public Member Functions

 AZ_COMPONENT (UiTransform2dComponent, LyShine::UiTransform2dComponentUuid, AZ::Component)
 
float GetZRotation () override
 
void SetZRotation (float rotation) override
 
AZ::Vector2 GetScale () override
 
void SetScale (AZ::Vector2 scale) override
 
float GetScaleX () override
 
void SetScaleX (float scale) override
 
float GetScaleY () override
 
void SetScaleY (float scale) override
 
AZ::Vector2 GetPivot () override
 
void SetPivot (AZ::Vector2 pivot) override
 
float GetPivotX () override
 
void SetPivotX (float pivot) override
 
float GetPivotY () override
 
void SetPivotY (float pivot) override
 
ScaleToDeviceMode GetScaleToDeviceMode () override
 
void SetScaleToDeviceMode (ScaleToDeviceMode scaleToDeviceMode) override
 
bool GetIsFlooringOffsets () override
 
void SetIsFlooringOffsets (bool isFlooringOffsets) override
 
void GetViewportSpacePoints (RectPoints &points) final
 
AZ::Vector2 GetViewportSpacePivot () final
 
void GetTransformToViewport (AZ::Matrix4x4 &mat) final
 
void GetTransformFromViewport (AZ::Matrix4x4 &mat) final
 
void RotateAndScalePoints (RectPoints &points) final
 
void GetCanvasSpacePoints (RectPoints &points) final
 
AZ::Vector2 GetCanvasSpacePivot () final
 
void GetTransformToCanvasSpace (AZ::Matrix4x4 &mat) final
 
void GetTransformFromCanvasSpace (AZ::Matrix4x4 &mat) final
 
void GetCanvasSpaceRectNoScaleRotate (Rect &rect) final
 
void GetCanvasSpacePointsNoScaleRotate (RectPoints &points) final
 
AZ::Vector2 GetCanvasSpaceSizeNoScaleRotate () final
 
AZ::Vector2 GetCanvasSpacePivotNoScaleRotate () final
 
void GetLocalTransform (AZ::Matrix4x4 &mat) final
 
void GetLocalInverseTransform (AZ::Matrix4x4 &mat) final
 
bool HasScaleOrRotation () final
 
AZ::Vector2 GetViewportPosition () final
 
void SetViewportPosition (const AZ::Vector2 &position) final
 
AZ::Vector2 GetCanvasPosition () final
 
void SetCanvasPosition (const AZ::Vector2 &position) final
 
AZ::Vector2 GetLocalPosition () final
 
void SetLocalPosition (const AZ::Vector2 &position) final
 
float GetLocalPositionX () final
 
void SetLocalPositionX (float position) final
 
float GetLocalPositionY () final
 
void SetLocalPositionY (float position) final
 
void MoveViewportPositionBy (const AZ::Vector2 &offset) final
 
void MoveCanvasPositionBy (const AZ::Vector2 &offset) final
 
void MoveLocalPositionBy (const AZ::Vector2 &offset) final
 
bool IsPointInRect (AZ::Vector2 point) final
 
bool BoundsAreOverlappingRect (const AZ::Vector2 &bound0, const AZ::Vector2 &bound1) final
 
void SetRecomputeFlags (Recompute recompute) final
 
bool HasCanvasSpaceRectChanged () final
 
bool HasCanvasSpaceSizeChanged () final
 
bool HasCanvasSpaceRectChangedByInitialization () final
 
void NotifyAndResetCanvasSpaceRectChange () final
 
Anchors GetAnchors () override
 
void SetAnchors (Anchors anchors, bool adjustOffsets, bool allowPush) override
 
Offsets GetOffsets () override
 
void SetOffsets (Offsets offsets) override
 
void SetPivotAndAdjustOffsets (AZ::Vector2 pivot) override
 
void SetLocalWidth (float width) override
 
float GetLocalWidth () override
 
void SetLocalHeight (float height) override
 
float GetLocalHeight () override
 
void PropertyValuesChanged () override
 
void RecomputeTransformsAndSendNotifications ()
 This is called from the canvas component during the update if the element was scheduled for a transform recompute.
 

Static Public Member Functions

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

Protected Member Functions

void Activate () override
 
void Deactivate () override
 
virtual bool IsControlledByParent () const
 Determine whether this element's transform is being overridden by a component on its parent.
 
virtual UiLayoutFitterInterface::FitType GetLayoutFitterType () const
 Get the level of control of a layout fitter.
 
bool IsNotControlledByParent () const
 
AZ::EntityId GetAncestorWithSameDimensionScaleToDevice (ScaleToDeviceMode scaleToDeviceMode) const
 
LyShine::EntityArray GetDescendantsWithSameDimensionScaleToDevice (ScaleToDeviceMode scaleToDeviceMode) const
 
bool AreAnchorsApartInSameScaleToDeviceDimension (ScaleToDeviceMode scaleToDeviceMode) const
 
AZStd::string GetScaleToDeviceModeWarningText () const
 
AZStd::string GetScaleToDeviceModeWarningTooltipText () const
 
const char * GetAnchorPropertyLabel () const
 
AZ::EntityId GetCanvasEntityId ()
 Helper function to get the canvas entity ID for canvas containing this element.
 
UiCanvasComponentGetCanvasComponent () const
 Helper function to get the canvas component for canvas containing this element.
 
void OnTransformPropertyChanged ()
 ChangeNotify function for when a transform property is changed.
 
void RecomputeTransformToViewportIfNeeded ()
 If m_recomputeTransformToViewport is true then recompute the transform and clear the flag.
 
void RecomputeTransformToCanvasSpaceIfNeeded ()
 If m_recomputeTransformToCanvasSpace is true then recompute the transform and clear the flag.
 

Member Function Documentation

◆ AreAnchorsApartInSameScaleToDeviceDimension()

bool UiTransform2dComponent::AreAnchorsApartInSameScaleToDeviceDimension ( ScaleToDeviceMode  scaleToDeviceMode) const
protected

Return whether there are anchors that are apart affecting the same dimension as this element's scale to device mode

◆ GetAncestorWithSameDimensionScaleToDevice()

AZ::EntityId UiTransform2dComponent::GetAncestorWithSameDimensionScaleToDevice ( ScaleToDeviceMode  scaleToDeviceMode) const
protected

Get the first ancestor that has a scale to device mode affecting the same dimension as this element's scale to device mode

◆ GetAnchorPropertyLabel()

const char* UiTransform2dComponent::GetAnchorPropertyLabel ( ) const
protected

This is used to dynamically change the label for the Anchor property in the properties pane as a way to display a "disabled" stated for this component when the transform is controlled by the parent.

◆ GetDescendantsWithSameDimensionScaleToDevice()

LyShine::EntityArray UiTransform2dComponent::GetDescendantsWithSameDimensionScaleToDevice ( ScaleToDeviceMode  scaleToDeviceMode) const
protected

Get a list of descendants that have a scale to device mode affecting the same dimension as this element's scale to device mode

◆ GetScaleToDeviceModeWarningText()

AZStd::string UiTransform2dComponent::GetScaleToDeviceModeWarningText ( ) const
protected

Return a short one line string that incudes a warning for the currently assigned scale to device mode. An empty string indicates no warnings

◆ GetScaleToDeviceModeWarningTooltipText()

AZStd::string UiTransform2dComponent::GetScaleToDeviceModeWarningTooltipText ( ) const
protected

Return a tooltip string describing the warning for the currently assigned scale to device mode. An empty string indicates no warnings

◆ IsNotControlledByParent()

bool UiTransform2dComponent::IsNotControlledByParent ( ) const
protected

Determine whether this element's transform is not being overridden by a component on its parent This just exists to be called from the edit context setup


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