Menu
Lumberyard
Developer Guide (Version 1.11)

UIScrollBoxComponent

Controls the characteristics of a scroll box.

UiScrollBoxBus

Services messages for the UiScrollBoxComponent.

FindClosestContentChildElement

Finds the child of the content element that is closest to the content anchors at the current scroll offset (the currently selected child).

Syntax

Copy
AZ::EntityId FindClosestContentChildElement()

GetContentEntity

Returns the content element for the scroll box.

Syntax

Copy
AZ::EntityId GetContentEntity()

GetHorizontalScrollBarEntity

Returns the horizontal scroll bar element for the scroll box.

Syntax

Copy
AZ::EntityId GetHorizontalScrollBarEntity()

GetHorizontalScrollBarVisibility

Returns the visibility behavior for the horizontal scroll bar of the scroll box.

Syntax

Copy
eUiScrollBoxScrollBarVisibility GetHorizontalScrollBarVisibility()

Following are possible values for eUiScrollBoxScrollBarVisibility.

Copy
enum eUiScrollBoxScrollBarVisibility { eUiScrollBoxScrollBarVisibility_AlwaysShow, eUiScrollBoxScrollBarVisibility_AutoHide, eUiScrollBoxScrollBarVisibility_AutoHideAndResizeViewport };

GetIsHorizontalScrollingEnabled

Returns whether the scroll box allows horizontal scrolling.

Syntax

Copy
bool GetIsHorizontalScrollingEnabled()

GetIsScrollingConstrained

Returns whether the scroll box restricts scrolling to the content area.

Syntax

Copy
bool GetIsScrollingConstrained()

GetIsVerticalScrollingEnabled

Returns whether the scroll box allows vertical scrolling.

Syntax

Copy
bool GetIsVerticalScrollingEnabled()

GetNormalizedScrollValue

Returns the scroll value from 0 – 1.

Syntax

Copy
AZ::Vector2 GetNormalizedScrollValue()

GetScrollOffset

Returns the scroll offset of the scroll box. The scroll offset is the offset from the content element's anchor point to the content element's pivot.

Syntax

Copy
AZ::Vector2 GetScrollOffset()

GetScrollOffsetChangedActionName

Returns the action triggered when the scroll box drag is completed.

Syntax

Copy
const AZStd::string& GetScrollOffsetChangedActionName()

GetScrollOffsetChangingActionName

Returns the action triggered while the scroll box is being dragged.

Syntax

Copy
AZStd::string& GetScrollOffsetChangingActionName()

GetSnapGrid

Returns the snapping grid of the scroll box.

Syntax

Copy
AZ::Vector2 GetSnapGrid()

GetSnapMode

Returns the snap mode for the scroll box.

Syntax

Copy
eUiScrollBoxSnapMode GetSnapMode()

Following are possible values for eUiScrollBoxSnapMode.

Copy
enum eUiScrollBoxSnapMode { eUiScrollBoxSnapMode_None, eUiScrollBoxSnapMode_Children, eUiScrollBoxSnapMode_Grid };

GetVerticalScrollBarEntity

Returns the vertical scroll bar element for the scroll box.

Syntax

Copy
AZ::EntityId GetVerticalScrollBarEntity()

GetVerticalScrollBarVisibility

Returns the visibility behavior for the vertical scroll bar of the scroll box.

Syntax

Copy
eUiScrollBoxScrollBarVisibility GetVerticalScrollBarVisibility()

HasHorizontalContentToScroll

Returns whether there is content to scroll horizontally.

Syntax

Copy
bool HasHorizontalContentToScroll()

HasVerticalContentToScroll

Returns whether there is content to scroll vertically.

Syntax

Copy
bool HasVerticalContentToScroll()

SetContentEntity

Sets the content element for the scroll box.

Syntax

Copy
void SetContentEntity(AZ::EntityId entityId)

SetHorizontalScrollBarEntity

Sets the horizontal scroll bar element for the scroll box.

Syntax

Copy
void SetHorizontalScrollBarEntity(AZ::EntityId entityId)

SetHorizontalScrollBarVisibility

Sets the visibility behavior for the horizontal scroll bar of the scroll box.

Syntax

Copy
void SetHorizontalScrollBarVisibility(eUiScrollBoxScrollBarVisibility visibility)

For possible values for eUiScrollBoxScrollBarVisibility, see GetHorizontalScrollBarVisibility.

SetIsHorizontalScrollingEnabled

Sets whether the scroll box allows horizontal scrolling.

Syntax

Copy
void SetIsHorizontalScrollingEnabled(bool isEnabled)

SetIsScrollingConstrained

Sets whether the scroll box restricts scrolling to the content area.

Syntax

Copy
void SetIsScrollingConstrained(bool isConstrained)

SetIsVerticalScrollingEnabled

Sets whether the scroll box allows vertical scrolling.

Syntax

Copy
void SetIsVerticalScrollingEnabled(bool isEnabled)

SetScrollOffset

Sets the scroll offset of the scroll box.

Syntax

Copy
void SetScrollOffset(AZ::Vector2 scrollOffset)

SetScrollOffsetChangedActionName

Sets the action triggered when the scroll box drag is completed.

Syntax

Copy
void SetScrollOffsetChangedActionName(const AZStd::string& actionName)

SetScrollOffsetChangingActionName

Sets the action triggered while the scroll box is being dragged.

Syntax

Copy
void SetScrollOffsetChangingActionName(const AZStd::string& actionName)

SetSnapGrid

Sets the snapping grid of the scroll box.

Syntax

Copy
void SetSnapGrid(AZ::Vector2 snapGrid)

SetSnapMode

Sets the snap mode for the scroll box.

Syntax

Copy
void SetSnapMode(eUiScrollBoxSnapMode snapMode)

For possible values for eUiScrollBoxSnapMode, see GetSnapMode.

SetVerticalScrollBarEntity

Sets the vertical scroll bar element for the scroll box.

Syntax

Copy
void SetVerticalScrollBarEntity(AZ::EntityId entityId)

SetVerticalScrollBarVisibility

Sets the visibility behavior for the vertical scroll bar of the scroll box.

Syntax

Copy
void SetVerticalScrollBarVisibility(eUiScrollBoxScrollBarVisibility visibility

UiScrollBoxNotificationBus

Services scroll offset change notifications for the UiScrollBoxComponent.

OnScrollOffsetChanged

Called when the scroll offset has changed.

Syntax

Copy
void OnScrollOffsetChanged(AZ::Vector2 newScrollOffset)

OnScrollOffsetChanging

Called when the scroll offset is changing.

Syntax

Copy
void OnScrollOffsetChanging(AZ::Vector2 newScrollOffset)

UiScrollableNotificationBus

Services scrollable value change notifications for the UiScrollBoxComponent.

OnScrollableValueChanged

Called when the scroll value (0 - 1) has changed.

Syntax

Copy
void OnScrollableValueChanged(AZ::Vector2 value)

OnScrollableValueChanging

Called when the scroll value (0 - 1) is changing.

Syntax

Copy
void OnScrollableValueChanging(AZ::Vector2 value)