Package gaiasky.gui
Class GamepadGui
java.lang.Object
gaiasky.gui.AbstractGui
gaiasky.gui.GamepadGui
-
Field Summary
Fields inherited from class gaiasky.gui.AbstractGui
backBufferHeight, backBufferWidth, graphics, interfaces, lock, name, skin, stage, unitsPerPixel, vr
-
Constructor Summary
ConstructorDescriptionGamepadGui
(com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.Graphics graphics, Float unitsPerPixel) GamepadGui
(com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.Graphics graphics, Float unitsPerPixel, boolean vrMode) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
back()
void
build()
boolean
checkString
(String text, Scene scene) void
doneLoading
(com.badlogic.gdx.assets.AssetManager assetManager) Hook that runs after the assets have been loaded.void
down()
com.badlogic.gdx.scenes.scene2d.ui.Table
void
initialize
(com.badlogic.gdx.assets.AssetManager assetManager, com.badlogic.gdx.graphics.g2d.SpriteBatch sb) Initializes the GUI, adding all the resources to the asset manager queue for loadingvoid
initialize
(com.badlogic.gdx.scenes.scene2d.Stage stage) void
left()
void
Event notification call.void
protected void
Adds the already created GUI objects to the stage.boolean
void
resizeImmediate
(int width, int height) Resizes without waiting for the current loop to finishvoid
right()
void
boolean
selectInCol
(int i, int j, boolean down) Selects the given object.boolean
selectInRow
(int i, int j, boolean right) Selects the given object.void
tabLeft()
void
tabRight()
void
up()
void
update
(double dt) Updates the GUIvoid
void
updateFocused
(boolean force) void
Methods inherited from class gaiasky.gui.AbstractGui
cancelTouchFocus, dispose, findActor, getBackBufferHeight, getBackBufferWidth, getGuiStage, getName, isVR, mustDraw, render, resize, setBackBufferSize, setVisibilityToggles, setVR, updateUnitsPerPixel
-
Constructor Details
-
Method Details
-
initialize
public void initialize(com.badlogic.gdx.assets.AssetManager assetManager, com.badlogic.gdx.graphics.g2d.SpriteBatch sb) Description copied from interface:IGui
Initializes the GUI, adding all the resources to the asset manager queue for loading- Parameters:
assetManager
- The asset manager to load the resources withsb
- The sprite batch to use for this GUI's stage
-
initialize
public void initialize(com.badlogic.gdx.scenes.scene2d.Stage stage) -
build
public void build() -
rebuildGui
protected void rebuildGui()Description copied from class:AbstractGui
Adds the already created GUI objects to the stage.- Specified by:
rebuildGui
in classAbstractGui
-
checkString
-
doneLoading
public void doneLoading(com.badlogic.gdx.assets.AssetManager assetManager) Description copied from interface:IGui
Hook that runs after the assets have been loaded. Completes the initialization process- Parameters:
assetManager
- The asset manager
-
update
public void update(double dt) Description copied from interface:IGui
Updates the GUI- Specified by:
update
in interfaceIGui
- Overrides:
update
in classAbstractGui
- Parameters:
dt
- Time in seconds since the last frame
-
updateTabs
public void updateTabs() -
selectInRow
public boolean selectInRow(int i, int j, boolean right) Selects the given object. If it is null, it scans the row in the given direction until all elements have been scanned.- Parameters:
i
- The columnj
- The rowright
- Whether scan right or left- Returns:
- True if the element was selected, false otherwise
-
selectInCol
public boolean selectInCol(int i, int j, boolean down) Selects the given object. If it is null, it scans the column in the given direction until all elements have been scanned.- Parameters:
i
- The columnj
- The rowdown
- Whether scan up or down- Returns:
- True if the element was selected, false otherwise
-
selectFirst
public void selectFirst() -
updateFocused
public void updateFocused() -
updateFocused
public void updateFocused(boolean force) -
tabLeft
public void tabLeft() -
tabRight
public void tabRight() -
up
public void up() -
down
public void down() -
left
public void left() -
right
public void right() -
back
public void back() -
getContent
public com.badlogic.gdx.scenes.scene2d.ui.Table getContent() -
notify
Description copied from interface:IObserver
Event notification call.- Specified by:
notify
in interfaceIObserver
- Overrides:
notify
in classAbstractGui
- Parameters:
event
- The event type.source
- The source object, if any.data
- The data associated with this event.
-
removeGamepadGui
public boolean removeGamepadGui() -
addGamepadGui
public void addGamepadGui() -
programmaticUpdate
public void programmaticUpdate() -
resizeImmediate
public void resizeImmediate(int width, int height) Description copied from interface:IGui
Resizes without waiting for the current loop to finish- Specified by:
resizeImmediate
in interfaceIGui
- Overrides:
resizeImmediate
in classAbstractGui
- Parameters:
width
- The new widthheight
- The new height
-