public class UiContainer extends ParentUiElement implements com.badlogic.gdx.InputProcessor
update(float),
 interpolate(float) and render(Graphics) must be called by
 your GameContainerasyncRemoveAll, children, renderNodedeferredLayout, deferredRender, deferredUpdate, effects, height, styleId, visibility, width, x, y, zIndex| Constructor and Description | 
|---|
| UiContainer(GameContainer gc,
           com.badlogic.gdx.assets.AssetManager assetManager)Constructor | 
| UiContainer(int width,
           int height,
           com.badlogic.gdx.assets.AssetManager assetManager) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addActionKey(int keycode)Add the key used for triggering actions (i.e. | 
| void | addControllerInput(ControllerUiInput<?> input)Adds a  ControllerUiInputinstance to thisUiContainer | 
| void | addListener(UiContainerListener listener)Adds a  UiContainerListenerto thisUiContainer | 
| void | addScreenSizeListener(ScreenSizeListener listener)Adds a  ScreenSizeListenerto listen forScreenSizechange | 
| void | attach(ParentRenderNode<?,?> parentRenderNode)Attaches a  RenderNodefor this element to a parentRenderNode | 
| boolean | buttonDown(ControllerUiInput<?> controllerUiInput,
          ControllerButton button) | 
| boolean | buttonUp(ControllerUiInput<?> controllerUiInput,
        ControllerButton button) | 
| void | clearActionKeys()Clears the keys used for triggering actions (i.e. | 
| void | clearActiveAction() | 
| void | clearActiveNavigation()Clears the current  Navigatablebeing navigated | 
| protected ParentRenderNode<?,?> | createRenderNode(ParentRenderNode<?,?> parent)Creates the  ParentRenderNodefor thisUiElement | 
| void | detach(ParentRenderNode<?,?> parentRenderNode)Detaches this element's  RenderNodefrom a parentRenderNode | 
| void | dispose() | 
| ActionableRenderNode | getActiveAction()Returns the currently hovered  ActionableRenderNode | 
| Navigatable | getActiveNavigation()Returns the currently active  Navigatable | 
| static Visibility | getDefaultVisibility()Returns the default  Visibilityfor newly createdUiElementobjects | 
| float | getHeight()Returns the height of the  UiContainer | 
| ControllerType | getLastControllerType()Returns the last  ControllerTypeused on theUiContainer | 
| InputSource | getLastInputSource()Returns the last  InputSourceused on theUiContainer | 
| float | getScaleX()Returns the configured  Graphicsscaling during rendering | 
| float | getScaleY()Returns the configured  Graphicsscaling during rendering | 
| ScreenSizeScaleMode | getScreenSizeScaleMode()Returns the scaling mode used for  ScreenSizevalues | 
| static UiContainerState | getState()Returns the current  UiContainerState | 
| StyleRule | getStyleRule() | 
| static UiTheme | getTheme()Returns the  UiThemecurrently applied to thisUiContainer | 
| float | getWidth()Returns the width of the  UiContainer | 
| void | interpolate(float alpha)Interpolates all  UiElements | 
| static boolean | isThemeApplied()Returns if a  UiThemehas been applied to thiUiContainer | 
| boolean | keyDown(int keycode) | 
| boolean | keyNavigationAllowed()Returns if this  UiContainercan be navigated by keyboard/controller | 
| boolean | keyTyped(char character) | 
| boolean | keyUp(int keycode) | 
| boolean | mouseMoved(int screenX,
          int screenY) | 
| boolean | pointerNavigationAllowed()Returns if this  UiContainercan be navigated by touch/mouse | 
| static void | relayoutAllUiContainers() | 
| void | removeActionKey(int keycode)Removes a key used for triggering actions (i.e. | 
| void | removeControllerInput(ControllerUiInput<?> input)Removes a  ControllerUiInputinstance from thisUiContainer | 
| void | removeListener(UiContainerListener listener)Removes a  UiContainerListenerfrom thisUiContainer | 
| void | removeScreenSizeListener(ScreenSizeListener listener)Removes a  ScreenSizeListenerfrom thisUiContainer | 
| void | render(Graphics g)Renders all visible  UiElements | 
| boolean | scrolled(int amount) | 
| void | set(int width,
   int height)Sets the width and height of the  UiContainer | 
| void | setActiveAction(ActionableRenderNode actionable) | 
| void | setActiveNavigation(Navigatable activeNavigation)Sets the current  Navigatablefor UI navigation | 
| static void | setDefaultVisibility(Visibility defaultVisibility)Sets the default  Visibilityfor newly createdUiElementobjects | 
| void | setLastControllerType(ControllerType lastControllerType)Sets the last  ControllerTypeused on theUiContainer | 
| void | setLastInputSource(InputSource lastInputSource)Sets the last  InputSourceused on theUiContainer | 
| void | setNavigationMode(NavigationMode navigationMode)Sets the  NavigationModeon thisUiContainer | 
| void | setPassThroughMouseMovement(boolean passThroughMouseMovement)Set to true if mouseMoved() events to should pass through this input handler regardless | 
| void | setScale(float scaleX,
        float scaleY)Sets the  Graphicsscaling during rendering. | 
| void | setScreenSizeScaleMode(ScreenSizeScaleMode screenSizeScaleMode)Sets the scaling mode used for  ScreenSizevalues | 
| void | setStyleId(java.lang.String styleId)Sets the style if for this  UiElement | 
| static void | setTheme(UiTheme theme)Sets the current  UiThemefor thisUiContainer | 
| void | setVisibility(Visibility visibility)Sets the current  Visibilityof thisUiElement | 
| void | setZIndex(int zIndex)Sets the Z index of this  UiElement. | 
| boolean | touchDown(int screenX,
         int screenY,
         int pointer,
         int button) | 
| boolean | touchDragged(int screenX,
            int screenY,
            int pointer) | 
| boolean | touchUp(int screenX,
       int screenY,
       int pointer,
       int button) | 
| void | update(float delta)Updates all  UiElements | 
add, add, get, getChild, getElementById, getFlexLayout, getRenderHeight, getRenderWidth, getRenderX, getRenderY, getTotalChildren, invokeBeginHover, invokeEndHover, isFlexLayout, isInitialLayoutOccurred, isInitialUpdateOccurred, isOverflowClipped, isRenderNodeDirty, remove, remove, removeAll, removeAllAsync, setFlex, setFlexLayout, setHeightFlex, setOverflowClipped, setRenderNodeDirty, setWidthFlex, setXFlex, setXYFlex, setYFlex, shrinkToContents, shrinkToContents, syncWithUpdateaddEffectListener, addHoverListener, addNodeStateListener, alignAbove, alignBelow, alignEdgeToEdge, alignLeftOf, alignRightOf, applyEffect, deferUntilLayout, deferUntilLayout, deferUntilRender, deferUntilRender, deferUntilUpdate, deferUntilUpdate, deferUntilUpdate, deferUntilUpdate, equals, getContentHeight, getContentWidth, getId, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getStyleId, getVisibility, getX, getY, getZIndex, hashCode, isDebugEnabled, isInitialised, notifyEffectListenersOnFinished, notifyHoverListenersOnBeginHover, notifyHoverListenersOnEndHover, notifyNodeStateListeners, removeEffectListener, removeHoverListener, removeNodeStateListener, set, setContentHeight, setContentWidth, setDebugEnabled, setHeight, setHeightToContentHeightOf, setHeightToHeightOf, setWidth, setWidthToContentWidthOf, setWidthToWidthOf, setX, setXY, setY, snapTo, snapTo, syncWithLayout, syncWithRenderpublic UiContainer(GameContainer gc, com.badlogic.gdx.assets.AssetManager assetManager)
gc - Your game's GameContainerassetManager - The AssetManager for the gamepublic UiContainer(int width,
                   int height,
                   com.badlogic.gdx.assets.AssetManager assetManager)
public static void relayoutAllUiContainers()
public void dispose()
protected ParentRenderNode<?,?> createRenderNode(ParentRenderNode<?,?> parent)
ParentUiElementParentRenderNode for this UiElementcreateRenderNode in class ParentUiElementparent - The parent of this nodeParentRenderNodepublic void update(float delta)
UiElementsdelta - The time since the last frame (in seconds)public void interpolate(float alpha)
UiElementsalpha - The interpolation alphapublic void render(Graphics g)
UiElementsg - The Graphics contextpublic void attach(ParentRenderNode<?,?> parentRenderNode)
UiElementRenderNode for this element to a parent
 RenderNodeattach in class ParentUiElementparentRenderNode - The parent RenderNode to attach topublic void detach(ParentRenderNode<?,?> parentRenderNode)
UiElementRenderNode from a parent
 RenderNodedetach in class ParentUiElementparentRenderNode - The parent RenderNode to detach frompublic void setVisibility(Visibility visibility)
UiElementVisibility of this UiElementsetVisibility in class ParentUiElementvisibility - The Visibility to setpublic void addScreenSizeListener(ScreenSizeListener listener)
ScreenSizeListener to listen for ScreenSize changelistener - The ScreenSizeListener to addpublic void removeScreenSizeListener(ScreenSizeListener listener)
ScreenSizeListener from this UiContainerlistener - The ScreenSizeListener to removepublic static boolean isThemeApplied()
UiTheme has been applied to thi UiContainerUiTheme has been appliedpublic static UiTheme getTheme()
UiTheme currently applied to this UiContainerUiTheme has been appliedpublic static void setTheme(UiTheme theme)
UiTheme for this UiContainertheme - The UiTheme to applypublic static UiContainerState getState()
UiContainerStatepublic void setStyleId(java.lang.String styleId)
UiElementUiElementsetStyleId in class ParentUiElementstyleId - The style id to setpublic boolean touchDown(int screenX,
                         int screenY,
                         int pointer,
                         int button)
touchDown in interface com.badlogic.gdx.InputProcessorpublic boolean touchUp(int screenX,
                       int screenY,
                       int pointer,
                       int button)
touchUp in interface com.badlogic.gdx.InputProcessorpublic boolean touchDragged(int screenX,
                            int screenY,
                            int pointer)
touchDragged in interface com.badlogic.gdx.InputProcessorpublic boolean mouseMoved(int screenX,
                          int screenY)
mouseMoved in interface com.badlogic.gdx.InputProcessorpublic boolean scrolled(int amount)
scrolled in interface com.badlogic.gdx.InputProcessorpublic boolean keyTyped(char character)
keyTyped in interface com.badlogic.gdx.InputProcessorpublic boolean keyDown(int keycode)
keyDown in interface com.badlogic.gdx.InputProcessorpublic boolean keyUp(int keycode)
keyUp in interface com.badlogic.gdx.InputProcessorpublic boolean buttonDown(ControllerUiInput<?> controllerUiInput, ControllerButton button)
public boolean buttonUp(ControllerUiInput<?> controllerUiInput, ControllerButton button)
public void setActiveAction(ActionableRenderNode actionable)
public void setActiveNavigation(Navigatable activeNavigation)
Navigatable for UI navigationactiveNavigation - The current Navigatable being navigatedpublic void clearActiveAction()
public void clearActiveNavigation()
Navigatable being navigatedpublic Navigatable getActiveNavigation()
Navigatablepublic ActionableRenderNode getActiveAction()
ActionableRenderNodepublic float getWidth()
UiContainerpublic float getHeight()
UiContainerpublic StyleRule getStyleRule()
getStyleRule in class UiElementpublic void set(int width,
                int height)
UiContainerwidth - The width in pixelsheight - The height in pixelspublic float getScaleX()
Graphics scaling during renderingpublic float getScaleY()
Graphics scaling during renderingpublic void setScale(float scaleX,
                     float scaleY)
Graphics scaling during rendering. Mouse/touch
 coordinates will be scaled accordingly.scaleX - Scaling along the X axisscaleY - Scaling along the Y axispublic InputSource getLastInputSource()
InputSource used on the UiContainerpublic void setLastInputSource(InputSource lastInputSource)
InputSource used on the UiContainerlastInputSource - The InputSource last usedpublic ControllerType getLastControllerType()
ControllerType used on the UiContainerpublic void setLastControllerType(ControllerType lastControllerType)
ControllerType used on the UiContainerlastControllerType - The ControllerType last usedpublic void addControllerInput(ControllerUiInput<?> input)
ControllerUiInput instance to this UiContainerinput - The instance to addpublic void removeControllerInput(ControllerUiInput<?> input)
ControllerUiInput instance from this
 UiContainerinput - The instance to removepublic void setZIndex(int zIndex)
UiElementUiElement. Elements will be rendered on
 different Z layers in ascending Z order (negatives values first, positive values last)setZIndex in class ParentUiElementzIndex - The Z indexpublic void addActionKey(int keycode)
keycode - The Input.Keys valuepublic void removeActionKey(int keycode)
keycode - The Input.Keys valuepublic void clearActionKeys()
public void setPassThroughMouseMovement(boolean passThroughMouseMovement)
passThroughMouseMovement - public boolean keyNavigationAllowed()
UiContainer can be navigated by keyboard/controllerpublic boolean pointerNavigationAllowed()
UiContainer can be navigated by touch/mousepublic void setNavigationMode(NavigationMode navigationMode)
NavigationMode on this UiContainernavigationMode - The NavigationModepublic ScreenSizeScaleMode getScreenSizeScaleMode()
ScreenSize valuesScreenSizeScaleMode.NO_SCALING by defaultpublic void setScreenSizeScaleMode(ScreenSizeScaleMode screenSizeScaleMode)
ScreenSize valuesscreenSizeScaleMode - The ScreenSizeScaleMode to setpublic void addListener(UiContainerListener listener)
UiContainerListener to this UiContainerlistener - The UiContainerListener to be notified of eventspublic void removeListener(UiContainerListener listener)
UiContainerListener from this UiContainerlistener - The UiContainerListener to stop receiving eventspublic static Visibility getDefaultVisibility()
Visibility for newly created
 UiElement objectsVisibility value. Visibility.HIDDEN by
         defaultpublic static void setDefaultVisibility(Visibility defaultVisibility)
Visibility for newly created UiElement
 objectsdefaultVisibility - The Visibility to set as default