content
protected com.badlogic.gdx.scenes.scene2d.ui.Table content
com.badlogic.gdx.scenes.scene2d.utils.Cullable, com.badlogic.gdx.scenes.scene2d.utils.Layout, IScreenGenericScreen extends Table to provide a structured layout that occupies the entire
application viewport. It handles common UI concerns such as managing modal overlays, input redirection,
keyboard shortcuts (ESC, ENTER, TAB), gamepad listeners, and tabbed content interfaces.
This class provides a consistent framework for creating dialogs, menus, or main screens. It automatically manages the focus hierarchy, input processors, and event listeners when the screen is shown or hidden.
By default, the screen layout consists of four parts:
To create a new screen, extend GenericScreen and:
build(): Populate the content table with your UI actors.accept(): Define what happens when the Accept button is clicked.cancel(): Define what happens when the Cancel button is clicked.setKeyboardFocus(): Set focus to a specific widget when the
screen is shown.com.badlogic.gdx.scenes.scene2d.ui.Table.Debug, com.badlogic.gdx.scenes.scene2d.ui.Table.DebugRectcom.badlogic.gdx.scenes.scene2d.ui.TextButtonprotected Runnableprotected Set<com.badlogic.gdx.controllers.ControllerListener> protected Set<AbstractMouseKbdListener> protected com.badlogic.gdx.scenes.scene2d.ui.Tableprotected com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroupcom.badlogic.gdx.scenes.scene2d.ui.TextButtonprotected Runnableprotected Runnableprotected com.badlogic.gdx.scenes.scene2d.ui.Tableprotected booleanprotected booleanprotected booleanprotected booleanprotected AbstractGamepadListenerprotected com.badlogic.gdx.scenes.scene2d.InputListenerprotected booleanprotected GenericScreenprotected AbstractMouseKbdListenerprotected static final floatprotected static final floatprotected static final floatprotected static final floatprotected com.badlogic.gdx.utils.Array<OwnScrollPane> protected intprotected final com.badlogic.gdx.scenes.scene2d.ui.Skinprotected final com.badlogic.gdx.scenes.scene2d.Stageprotected com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.ui.TextButton> protected com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.Group> protected com.badlogic.gdx.scenes.scene2d.ui.StackbackgroundBottom, backgroundLeft, backgroundRight, backgroundTop, debugActorColor, debugCellColor, debugTableColorPOOLSGenericScreen(String title,
com.badlogic.gdx.scenes.scene2d.ui.Skin skin,
com.badlogic.gdx.scenes.scene2d.Stage stage) protected abstract booleanaccept()com.badlogic.gdx.scenes.scene2d.ui.Buttonvoidact(float delta) voidvoidaddSeparator(int colSpan) protected voidaddTabContent(com.badlogic.gdx.scenes.scene2d.Group tabContent) protected abstract voidbuild()voidprotected abstract voidcancel()com.badlogic.gdx.scenes.scene2d.ui.Buttonbooleanbooleanabstract voiddispose()protected voidenableComponents(boolean enabled,
com.badlogic.gdx.scenes.scene2d.utils.Disableable... components) voidcom.badlogic.gdx.scenes.scene2d.Groupcom.badlogic.gdx.scenes.scene2d.ui.Tablecom.badlogic.gdx.scenes.scene2d.Groupcom.badlogic.gdx.scenes.scene2d.ui.Tablecom.badlogic.gdx.scenes.scene2d.Groupcom.badlogic.gdx.scenes.scene2d.StagegetStage()com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.ui.TextButton> com.badlogic.gdx.scenes.scene2d.ui.Tablebooleanbooleanbooleanvoidhide()voidhide(com.badlogic.gdx.scenes.scene2d.Action action) protected voidvoidsetAcceptButtonColor(com.badlogic.gdx.graphics.Color col) voidsetAcceptButtonStyle(String style) voidvoidsetAcceptText(String acceptText) voidsetCancelButtonColors(com.badlogic.gdx.graphics.Color textColor,
com.badlogic.gdx.graphics.Color buttonColor) voidsetCancelButtonStyle(String style) voidvoidsetCancelText(String cancelText) voidvoidprotected voidshow(com.badlogic.gdx.scenes.scene2d.Stage stage) Packs the dialog and adds it to the stage, centered with
default fadeIn action.show(com.badlogic.gdx.scenes.scene2d.Stage stage,
float x,
float y) Packs the dialog and adds it to the stage at the specified position.show(com.badlogic.gdx.scenes.scene2d.Stage stage,
com.badlogic.gdx.scenes.scene2d.Action action) Packs the dialog and adds it to the stage with custom
action which can be null for instant show.protected voidshowDialogHook(com.badlogic.gdx.scenes.scene2d.Stage stage) booleantabLeft()booleantabRight()voidtouch()add, add, add, add, add, add, add, align, background, background, bottom, center, clearChildren, clip, clip, columnDefaults, debug, debug, debugActor, debugAll, debugCell, debugTable, defaults, draw, drawBackground, drawDebug, drawDebugBounds, getAlign, getBackground, getCell, getCells, getClip, getColumnMinWidth, getColumnPrefWidth, getColumns, getColumnWidth, getMinHeight, getMinWidth, getPadBottom, getPadBottomValue, getPadLeft, getPadLeftValue, getPadRight, getPadRightValue, getPadTop, getPadTopValue, getPadX, getPadY, getPrefHeight, getPrefWidth, getRow, getRowHeight, getRowMinHeight, getRowPrefHeight, getRows, getSkin, getTableDebug, hit, invalidate, layout, left, pad, pad, pad, pad, padBottom, padBottom, padLeft, padLeft, padRight, padRight, padTop, padTop, removeActor, removeActor, removeActorAt, reset, right, row, setBackground, setBackground, setClip, setDebug, setRound, setSkin, stack, topchildrenChanged, getMaxHeight, getMaxWidth, invalidateHierarchy, needsLayout, pack, setFillParent, setLayoutEnabled, sizeChanged, validateaddActor, addActorAfter, addActorAt, addActorBefore, applyTransform, applyTransform, clear, clear, clearChildren, computeTransform, drawChildren, drawDebugChildren, findActor, getChild, getChildren, getCullingArea, hasChildren, isTransform, localToDescendantCoordinates, resetTransform, resetTransform, setCullingArea, setDebug, setStage, setTransform, swapActor, swapActor, toStringaddAction, addCaptureListener, addListener, ancestorsVisible, ascendantsVisible, clearActions, clearListeners, clipBegin, clipBegin, clipEnd, fire, firstAscendant, getActions, getCaptureListeners, getColor, getDebug, getHeight, getListeners, getName, getOriginX, getOriginY, getParent, getRight, getRotation, getScaleX, getScaleY, getTop, getTouchable, getUserObject, getWidth, getX, getX, getY, getY, getZIndex, hasActions, hasKeyboardFocus, hasParent, hasScrollFocus, isAscendantOf, isDescendantOf, isTouchable, isTouchFocusListener, isTouchFocusTarget, isVisible, localToActorCoordinates, localToAscendantCoordinates, localToParentCoordinates, localToScreenCoordinates, localToStageCoordinates, moveBy, notify, parentToLocalCoordinates, positionChanged, remove, removeAction, removeCaptureListener, removeListener, rotateBy, rotationChanged, scaleBy, scaleBy, scaleChanged, screenToLocalCoordinates, setBounds, setColor, setColor, setHeight, setName, setOrigin, setOrigin, setOriginX, setOriginY, setParent, setPosition, setPosition, setRotation, setScale, setScale, setScaleX, setScaleY, setSize, setTouchable, setUserObject, setVisible, setWidth, setX, setX, setY, setY, setZIndex, sizeBy, sizeBy, stageToLocalCoordinates, toBack, toFrontclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBottomGroup
tabContent - The contents.closeAccept in interface IScreencloseCancel in interface IScreenPacks the dialog and adds it to the stage with custom
action which can be null for instant show.stage - The stage.action - Action to run.getCurrentContentContainer in interface IScreengetButtonsGroup in interface IScreenPacks the dialog and adds it to the stage, centered with
default fadeIn action.Packs the dialog and adds it to the stage at the specified position.colSpan - The column span to use.r - The listener.r - The listener.r - The listener.enabled - The state to set.components - The components to enable or disable.act in class com.badlogic.gdx.scenes.scene2d.GroupacceptButton in interface IScreencancelButton in interface IScreen