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

Inherits AZ::ComponentBus.

Public Types

enum class  SnapMode { None , Children , Grid }
 
enum class  ScrollBarVisibility { AlwaysShow , AutoHide , AutoHideAndResizeViewport }
 
typedef AZStd::function< void(AZ::EntityId sendingEntityId, AZ::Vector2 newScrollOffset)> ScrollOffsetChangeCallback
 Callback for when box is scrolled.
 

Public Member Functions

virtual AZ::Vector2 GetScrollOffset ()=0
 
virtual void SetScrollOffset (AZ::Vector2 scrollOffset)=0
 
virtual AZ::Vector2 GetNormalizedScrollValue ()=0
 Get the scroll value from 0 - 1.
 
virtual void ChangeContentSizeAndScrollOffset (AZ::Vector2 contentSize, AZ::Vector2 scrollOffset)=0
 Change content size and scroll offset, and handle the changes.
 
virtual bool HasHorizontalContentToScroll ()=0
 Get whether there is content to scroll horizontally.
 
virtual bool HasVerticalContentToScroll ()=0
 Get whether there is content to scroll vertically.
 
virtual bool GetIsHorizontalScrollingEnabled ()=0
 Get whether horizontal scrolling interaction is enabled.
 
virtual void SetIsHorizontalScrollingEnabled (bool isEnabled)=0
 Set whether horizontal scrolling interaction is enabled.
 
virtual bool GetIsVerticalScrollingEnabled ()=0
 Get whether vertical scrolling interaction is enabled.
 
virtual void SetIsVerticalScrollingEnabled (bool isEnabled)=0
 Set whether vertical scrolling interaction is enabled.
 
virtual bool GetIsScrollingConstrained ()=0
 Get whether scrolling interaction is constrained to the content area.
 
virtual void SetIsScrollingConstrained (bool isConstrained)=0
 Set whether vertical scrolling interaction is constrained to the content area.
 
virtual SnapMode GetSnapMode ()=0
 Get snap mode.
 
virtual void SetSnapMode (SnapMode snapMode)=0
 Set snap mode.
 
virtual AZ::Vector2 GetSnapGrid ()=0
 Get snap grid.
 
virtual void SetSnapGrid (AZ::Vector2 snapGrid)=0
 Set snap grid.
 
virtual ScrollBarVisibility GetHorizontalScrollBarVisibility ()=0
 Get horizontal scrollbar visibility behavior.
 
virtual void SetHorizontalScrollBarVisibility (ScrollBarVisibility visibility)=0
 Set horizontal scrollbar visibility behavior.
 
virtual ScrollBarVisibility GetVerticalScrollBarVisibility ()=0
 Get vertical scrollbar visibility behavior.
 
virtual void SetVerticalScrollBarVisibility (ScrollBarVisibility visibility)=0
 Set vertical scrollbar visibility behavior.
 
virtual ScrollOffsetChangeCallback GetScrollOffsetChangingCallback ()=0
 Get the callback invoked while the scroll offset is changing.
 
virtual void SetScrollOffsetChangingCallback (ScrollOffsetChangeCallback onChange)=0
 Set the callback invoked while the scroll offset is changing.
 
virtual const LyShine::ActionNameGetScrollOffsetChangingActionName ()=0
 Get the action triggered while the scroll offset is changing.
 
virtual void SetScrollOffsetChangingActionName (const LyShine::ActionName &actionName)=0
 Set the action triggered while the scroll offset is changing.
 
virtual ScrollOffsetChangeCallback GetScrollOffsetChangedCallback ()=0
 Get the callback invoked when the scroll offset is done changing.
 
virtual void SetScrollOffsetChangedCallback (ScrollOffsetChangeCallback onChange)=0
 Set the callback invoked when the scroll offset is done changing.
 
virtual const LyShine::ActionNameGetScrollOffsetChangedActionName ()=0
 Get the action triggered when the scroll offset is done changing.
 
virtual void SetScrollOffsetChangedActionName (const LyShine::ActionName &actionName)=0
 Set the action triggered when the scroll offset is done changing.
 
virtual void SetContentEntity (AZ::EntityId entityId)=0
 Set the optional content entity, if none is specified then nothing gets scrolled.
 
virtual AZ::EntityId GetContentEntity ()=0
 Get the optional content entity.
 
virtual void SetHorizontalScrollBarEntity (AZ::EntityId entityId)=0
 Set the optional horizontal scrollbar entity.
 
virtual AZ::EntityId GetHorizontalScrollBarEntity ()=0
 Get the optional horizontal scrollbar entity.
 
virtual void SetVerticalScrollBarEntity (AZ::EntityId entityId)=0
 Set the optional vertical scrollbar entity.
 
virtual AZ::EntityId GetVerticalScrollBarEntity ()=0
 Get the optional vertical scrollbar entity.
 
virtual AZ::EntityId FindClosestContentChildElement ()=0
 

Static Public Attributes

static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single
 Only one component on a entity can implement the events.
 

Member Function Documentation

◆ FindClosestContentChildElement()

virtual AZ::EntityId UiScrollBoxInterface::FindClosestContentChildElement ( )
pure virtual

Find the child of the content element that is closest to the content anchors at the current scroll offset. i.e. what is the currently "selected" child

◆ GetScrollOffset()

virtual AZ::Vector2 UiScrollBoxInterface::GetScrollOffset ( )
pure virtual

Query the current scroll offset of the scroll box

Returns
The current scroll offset for the scroll box.

The scroll offset is the offset from the content element's anchor point to the content element's pivot. If the content element's anchor points are split it is the offset from their center to the pivot. So if the mouse is dragged left, the content moves to the left, so the offset X has the X drag amount subtracted from it. Using the offset from the anchor to the pivot allows the offset to be center to center or top-left to top-left, or any combination of the possible anchor and pivot positions

◆ SetScrollOffset()

virtual void UiScrollBoxInterface::SetScrollOffset ( AZ::Vector2  scrollOffset)
pure virtual

Set the scroll offset of the scroll box

Parameters
isOnThe new desired scroll offset of the scroll box.

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