Menu
Lumberyard
Developer Guide (Version 1.11)

UiDropdownComponent

You can use UiDropdownComponent to implement a UI dropdown menu in Amazon Lumberyard.

UiDropdownBus

Services messages for the UiDropdownComponent.

GetValue

Returns the value of the dropdown. The value is the last option that was selected.

Syntax

Copy
AZ::EntityId GetValue()

SetValue

Sets the value of the dropdown manually.

Syntax

Copy
void SetValue(AZ::EntityId value)

GetContent

Returns the content element that this dropdown expands.

Syntax

Copy
AZ::EntityId GetContent()

SetContent

Sets the content element that this dropdown expands.

Syntax

Copy
void SetContent(AZ::EntityId content)

GetExpandOnHover

Returns whether this dropdown should expand automatically on hover.

Syntax

Copy
bool GetExpandOnHover()

SetExpandOnHover

Sets whether this dropdown expands automatically on hover.

Syntax

Copy
void SetExpandOnHover(bool expandOnHover)

GetWaitTime

Returns how long to wait before expanding upon hover and collapsing upon exit.

Syntax

Copy
float GetWaitTime()

SetWaitTime

Sets how long to wait before expanding upon hover and collapsing upon exit.

Syntax

Copy
void SetWaitTime(float waitTime)

GetCollapseOnOutsideClick

Returns whether this dropdown collapses when the user clicks outside.

Syntax

Copy
bool GetCollapseOnOutsideClick()

SetCollapseOnOutsideClick

Sets whether this dropdown collapses when the user clicks outside.

Syntax

Copy
void SetCollapseOnOutsideClick(bool collapseOnOutsideClick)

GetExpandedParentId

Returns the element that the dropdown content parents to when expanded (the root element by default).

Syntax

Copy
AZ::EntityId GetExpandedParentId()

SetExpandedParentId

Sets the element that the dropdown content parents to when expanded.

Syntax

Copy
void SetExpandedParentId(AZ::EntityId expandedParentId)

GetTextElement

Returns the text element that displays the text of the currently selected option.

Syntax

Copy
bool GetCollapseOnOutsideClick()

SetTextElement

Sets the text element that displays the text of the currently selected option.

Syntax

Copy
void SetTextElement(AZ::EntityId textElement)

GetIconElement

Returns the icon element that displays the icon of the currently selected option.

Syntax

Copy
AZ::EntityId GetIconElement()

SetIconElement

Sets the icon element that displays the icon of the currently selected option.

Syntax

Copy
void SetIconElement(AZ::EntityId iconElement)

Expand

Expands the dropdown menu.

Syntax

Copy
void Expand()

Collapse

Collapses the dropdown menu.

Syntax

Copy
void Collapse()

GetExpandedActionName

Returns the name of the action that is sent when the dropdown is expanded.

Syntax

Copy
const LyShine::ActionName& GetExpandedActionName()

SetExpandedActionName

Sets the name of the action that is sent when the dropdown is expanded.

Syntax

Copy
void SetExpandedActionName(const LyShine::ActionName& actionName)

GetCollapsedActionName

Returns the name of the action that is sent when the dropdown is collapsed.

Syntax

Copy
const LyShine::ActionName& GetCollapsedActionName()

SetCollapsedActionName

Sets the name of the action that is sent when the dropdown is collapsed.

Syntax

Copy
void SetCollapsedActionName(const LyShine::ActionName& actionName)

GetOptionSelectedActionName

Returns the name of the action that is sent when the dropdown value is changed.

Syntax

Copy
const LyShine::ActionName& GetOptionSelectedActionName()

SetOptionSelectedActionName

Sets the name of the action that is sent when the dropdown value is changed.

Syntax

Copy
void SetOptionSelectedActionName(const LyShine::ActionName& actionName)

UiDropdownNotificationBus

Services notifications for the UiDropdownComponent.

OnDropdownExpanded

Notifies that the dropdown was expanded.

Syntax

Copy
void OnDropdownExpanded()

OnDropdownCollapsed

Notifies that the dropdown was collapsed.

Syntax

Copy
void OnDropdownCollapsed()

OnDropdownValueChanged

Notifies that an option was selected.

Syntax

Copy
void OnDropdownValueChanged(AZ::EntityId option)