Inherits AZ::Component, UiDynamicScrollBoxBus::Handler, UiScrollBoxNotificationBus::Handler, UiInitializationBus::Handler, UiTransformChangeNotificationBus::Handler, and UiElementNotificationBus::Handler.
|
| AZ_COMPONENT (UiDynamicScrollBoxComponent, LyShine::UiDynamicScrollBoxComponentUuid, AZ::Component) |
|
void | RefreshContent () override |
|
void | AddElementsToEnd (int numElementsToAdd, bool scrollToEndIfWasAtEnd) override |
|
void | RemoveElementsFromFront (int numElementsToRemove) override |
|
void | ScrollToEnd () override |
|
int | GetElementIndexOfChild (AZ::EntityId childElement) override |
|
int | GetSectionIndexOfChild (AZ::EntityId childElement) override |
|
AZ::EntityId | GetChildAtElementIndex (int index) override |
|
AZ::EntityId | GetChildAtSectionAndElementIndex (int sectionIndex, int index) override |
|
bool | GetAutoRefreshOnPostActivate () override |
|
void | SetAutoRefreshOnPostActivate (bool autoRefresh) override |
|
AZ::EntityId | GetPrototypeElement () override |
|
void | SetPrototypeElement (AZ::EntityId prototypeElement) override |
|
bool | GetElementsVaryInSize () override |
|
void | SetElementsVaryInSize (bool varyInSize) override |
|
bool | GetAutoCalculateVariableElementSize () override |
|
void | SetAutoCalculateVariableElementSize (bool autoCalculateSize) override |
|
float | GetEstimatedVariableElementSize () override |
|
void | SetEstimatedVariableElementSize (float estimatedSize) override |
|
bool | GetSectionsEnabled () override |
|
void | SetSectionsEnabled (bool enabled) override |
|
AZ::EntityId | GetPrototypeHeader () override |
|
void | SetPrototypeHeader (AZ::EntityId prototypeHeader) override |
|
bool | GetHeadersSticky () override |
|
void | SetHeadersSticky (bool stickyHeaders) override |
|
bool | GetHeadersVaryInSize () override |
|
void | SetHeadersVaryInSize (bool varyInSize) override |
|
bool | GetAutoCalculateVariableHeaderSize () override |
|
void | SetAutoCalculateVariableHeaderSize (bool autoCalculateSize) override |
|
float | GetEstimatedVariableHeaderSize () override |
|
void | SetEstimatedVariableHeaderSize (float estimatedSize) override |
|
void | OnScrollOffsetChanging (AZ::Vector2 newScrollOffset) override |
|
void | OnScrollOffsetChanged (AZ::Vector2 newScrollOffset) override |
|
void | InGamePostActivate () override |
|
void | OnCanvasSpaceRectChanged (AZ::EntityId entityId, const UiTransformInterface::Rect &oldRect, const UiTransformInterface::Rect &newRect) override |
|
void | OnUiElementBeingDestroyed () override |
|
|
void | Activate () override |
|
void | Deactivate () override |
|
| AZ_DISABLE_COPY_MOVE (UiDynamicScrollBoxComponent) |
|
void | PrepareListForDisplay () |
|
AZ::Entity * | GetContentEntity () const |
|
AZ::EntityId | ClonePrototypeElement (ElementType elementType, AZ::EntityId parentEntityId=AZ::EntityId()) const |
|
bool | IsPrototypeElement (AZ::EntityId entityId) const |
|
bool | AllPrototypeElementsValid () const |
|
bool | AnyPrototypeElementsNavigable () const |
|
bool | AnyElementTypesHaveVariableSize () const |
|
bool | AnyElementTypesHaveEstimatedSizes () const |
|
bool | AllElementTypesHaveEstimatedSizes () const |
|
bool | StickyHeadersEnabled () const |
|
void | ResizeContentToFitElements () |
|
void | ResizeContentElement (float newSize) const |
|
void | AdjustContentSizeAndScrollOffsetByDelta (float sizeDelta, float scrollDelta) const |
|
float | CalculateVariableElementSize (int index) |
|
float | GetAndCacheVariableElementSize (int index) |
|
float | GetVariableElementSize (int index) const |
|
int | GetLastKnownAccumulatedSizeIndex (int index, int numElementsWithUnknownSizeOut[ElementType::NumElementTypes]) const |
|
float | GetElementOffsetAtIndex (int index) const |
|
float | GetFixedSizeElementOffset (int index) const |
|
float | GetVariableSizeElementOffset (int index) const |
|
void | UpdateAverageElementSize (int numAddedElements, float sizeDelta) |
|
void | ClearDisplayedElements () |
|
AZ::EntityId | FindDisplayedElementWithIndex (int index) const |
|
float | GetVisibleAreaSize () const |
|
bool | AreAnyElementsVisible (AZ::Vector2 &visibleContentBoundsOut) const |
|
void | UpdateElementVisibility (bool keepAtEndIfWasAtEnd=false) |
|
void | CalculateVisibleElementIndices (bool keepAtEndIfWasAtEnd, const AZ::Vector2 &visibleContentBounds, int &firstVisibleElementIndexOut, int &lastVisibleElementIndexOut, int &firstDisplayedElementIndexOut, int &lastDisplayedElementIndexOut, int &firstDisplayedElementIndexWithSizeChangeOut, float &totalElementSizeChangeOut, float &scrollChangeOut) |
|
void | UpdateStickyHeader (int firstVisibleElementIndex, int lastVisibleElementIndex, float visibleContentBeginning) |
|
int | FindFirstVisibleHeaderIndex (int firstVisibleElementIndex, int lastVisibleElementIndex, int excludeIndex) |
|
void | FindVisibleElementIndicesForFixedSizes (const AZ::Vector2 &visibleContentBounds, int &firstVisibleElementIndexOut, int &lastVisibleElementIndexOut) const |
|
int | FindVisibleElementIndexToRemainInPlace (const AZ::Vector2 &visibleContentBounds) const |
|
void | AddExtraElementsForNavigation (int &firstDisplayedElementIndexOut, int &lastDisplayedElementIndexOut) const |
|
int | EstimateFirstVisibleElementIndex (const AZ::Vector2 &visibleContentBounds) const |
|
int | FindFirstVisibleElementIndex (int estimatedIndex, const AZ::Vector2 &visibleContentBounds, float &firstVisibleElementEndOut) const |
|
void | CalculateVisibleSpaceBeforeAndAfterElement (int visibleElementIndex, bool keepAtEnd, float visibleAreaBeginning, float &spaceLeftBeforeOut, float &spaceLeftAfterOut) const |
|
void | CalculateVisibleElementIndicesFromVisibleElementIndex (int visibleElementIndex, const AZ::Vector2 &visibleContentBound, bool keepAtEnd, int &firstVisibleElementIndexOut, int &lastVisibleElementIndexOut, int &firstDisplayedElementIndexOut, int &lastDisplayedElementIndexOut, int &firstDisplayedElementIndexWithSizeChangeOut, float &totalElementSizeChangeOut, float &scrollChangeOut) |
|
float | CalculateContentBeginningDeltaAfterSizeChange (float contentSizeDelta) const |
|
float | CalculateContentEndDeltaAfterSizeChange (float contentSizeDelta) const |
|
bool | IsScrolledToEnd () const |
|
bool | IsElementDisplayedAtIndex (int index) const |
|
AZ::EntityId | GetElementForDisplay (ElementType elementType) |
|
AZ::EntityId | GetElementForAutoSizeCalculation (ElementType elementType) |
|
void | DisableElementsForAutoSizeCalculation () const |
|
float | AutoCalculateElementSize (AZ::EntityId elementForAutoSizeCalculation) const |
|
void | SizeVariableElementAtIndex (AZ::EntityId element, int index) const |
|
void | PositionElementAtIndex (AZ::EntityId element, int index) const |
|
void | SetElementAnchors (AZ::EntityId element) const |
|
void | SetElementOffsets (AZ::EntityId element, float offset) const |
|
ElementType | GetElementTypeAtIndex (int index) const |
|
ElementIndexInfo | GetElementIndexInfoFromIndex (int index) const |
|
int | GetIndexFromElementIndexInfo (const ElementIndexInfo &elementIndexInfo) const |
|
AZ::EntityId | GetImmediateContentChildFromDescendant (AZ::EntityId childElement) const |
|
bool | HeadersHaveVariableSizes () const |
|
bool | IsValidPrototype (AZ::EntityId entityId) const |
|
This component dynamically sets up scrollbox content as a horizontal or vertical list of elements that are cloned from prototype entities. Only the minimum number of entities are created for efficient scrolling, and are reused when new elements come into view. The list can consist of only items, or it can be divided into sections that include a header at the beginning of each section, followed by items that belong to that section. The meaning of "element" differs in the public and private interface, mainly for backward compatibility. In the private interface, "element" refers to a generic entry in the list which can be of different types. Currently there are two types of elements: headers and items. In the public interface however, "element" means the same thing as "item" does in the private interface, and "item" is unused (the public interface does not need to define the concept of a generic entry in the list.) Both headers and items can have fixed sizes determined by their corresponding prototype entities, or they could vary in size. If they vary in size, another option is available to indicate whether to auto calculate the sizes or request the sizes via a bus interface. There is also the option to provide an estimated size that will be used until the elements scroll into view and their real size calculated. For lists with a large number of elements, it is advisable to use the estimated size as calculating the sizes of all elements up front could be costly. When elements vary in size, a cache is maintained and the element sizes are only calculated once.