Class UI2dScrollContainer

All Implemented Interfaces:
UI2dScrollInterface, UIContainer, LXLoopTask, Iterable<UIObject>
Direct Known Subclasses:
UIPerformancePane

public class UI2dScrollContainer extends UI2dContainer implements UI2dScrollInterface
  • Constructor Details

    • UI2dScrollContainer

      public UI2dScrollContainer(UI ui, float x, float y, float w, float h)
  • Method Details

    • setMaxWidth

      public UI2dScrollContainer setMaxWidth(float maxWidth)
      Sets a maximum width on the scroll container. Resize or dynamic layout operations up to this size will actually resize the container and texture itself. But past that point, scroll operation occurs.
      Parameters:
      maxWidth - Maximum width before scrolling kicks in
      Returns:
      this
    • setMaxWidth

      public UI2dScrollContainer setMaxWidth(float maxWidth, boolean reflow)
      Sets a maximum width on the scroll container. Resize or dynamic layout operations up to this size will actually resize the container and texture itself. But past that point, scroll operation occurs.
      Parameters:
      maxWidth - Maximum width before scrolling kicks in
      reflow - Reflow on this call
      Returns:
      this
    • setMaxHeight

      public UI2dScrollContainer setMaxHeight(float maxHeight)
      Sets a maximum height on the scroll container. Resize or dynamic layout operations up to this size will actually resize the container and texture itself. But past that point, scroll operation occurs.
      Parameters:
      maxHeight - Maximum height before scrolling kicks in
      Returns:
      this
    • setMaxHeight

      public UI2dScrollContainer setMaxHeight(float maxHeight, boolean reflow)
      Sets a maximum height on the scroll container. Resize or dynamic layout operations up to this size will actually resize the container and texture itself. But past that point, scroll operation occurs.
      Parameters:
      maxHeight - Maximum height before scrolling kicks in
      reflow - Reflow on this call
      Returns:
      this
    • setContentSize

      public UI2dContainer setContentSize(float w, float h)
      Overrides:
      setContentSize in class UI2dContainer
    • setScrollSize

      public UI2dScrollContainer setScrollSize(float scrollWidth, float scrollHeight)
      Sets the size of the scrolled content, which could potentially be larger than the actual size of this element itself
      Specified by:
      setScrollSize in interface UI2dScrollInterface
      Parameters:
      scrollWidth - Width of scrollable virtual pane
      scrollHeight - Height of scrollable virtual pane
      Returns:
    • getScrollHeight

      public float getScrollHeight()
      Gets the total height of scrollable content, which could be larger than the size of the container itself if vertical scrolling is occurring.
      Specified by:
      getScrollHeight in interface UI2dScrollInterface
      Overrides:
      getScrollHeight in class UI2dContainer
      Returns:
      Height of scrollable content
    • setScrollHeight

      public UI2dScrollContainer setScrollHeight(float scrollHeight)
      Specified by:
      setScrollHeight in interface UI2dScrollInterface
    • getScrollWidth

      public float getScrollWidth()
      Gets the total width of scrollable content, which could be larger than the size of the container itself if horizontal scrolling is occurring.
      Specified by:
      getScrollWidth in interface UI2dScrollInterface
      Overrides:
      getScrollWidth in class UI2dContainer
      Returns:
      Width of scrollable content
    • setScrollWidth

      public UI2dScrollContainer setScrollWidth(float scrollWidth)
      Specified by:
      setScrollWidth in interface UI2dScrollInterface
    • setHorizontalScrollingEnabled

      public UI2dScrollContainer setHorizontalScrollingEnabled(boolean horizontalScrollingEnabled)
    • setVerticalScrollingEnabled

      public UI2dScrollContainer setVerticalScrollingEnabled(boolean verticalScrollingEnabled)
    • hasScroll

      public boolean hasScroll()
    • onResize

      protected void onResize()
      Description copied from class: UI2dComponent
      Subclasses may override this method, invoked when the component is resized
      Overrides:
      onResize in class UI2dComponent
    • getScrollX

      public float getScrollX()
      Specified by:
      getScrollX in interface UI2dScrollInterface
    • getScrollY

      public float getScrollY()
      Specified by:
      getScrollY in interface UI2dScrollInterface
    • onScrollChange

      protected void onScrollChange()
    • setScrollX

      public UI2dScrollContainer setScrollX(float scrollX)
      Specified by:
      setScrollX in interface UI2dScrollInterface
    • setScrollY

      public UI2dScrollContainer setScrollY(float scrollY)
      Specified by:
      setScrollY in interface UI2dScrollInterface
    • onMouseDragged

      protected void onMouseDragged(MouseEvent mouseEvent, float mx, float my, float dx, float dy)
      Description copied from class: UIEventHandler
      Subclasses override to receive mouse events
      Overrides:
      onMouseDragged in class UIEventHandler
      Parameters:
      mouseEvent - Mouse event
      mx - x-coordinate
      my - y-coordinate
      dx - movement in x
      dy - movement in y
    • onMouseScroll

      protected void onMouseScroll(MouseEvent mouseEvent, float mx, float my, float dx, float dy)
      Description copied from class: UIEventHandler
      Subclasses override to receive mouse events
      Overrides:
      onMouseScroll in class UIEventHandler
      Parameters:
      mouseEvent - Mouse event
      mx - x-coordinate
      my - y-coordinate
      dx - Amount of horizontal scroll
      dy - Amount of vertical scroll