Class KeybindsButtonDisplay
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.ui.UIComponent
com.csse3200.game.components.tutorial.KeybindsButtonDisplay
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,Renderable
,Comparable<Renderable>
Displays Keybindings button
-
Field Summary
Fields inherited from class com.csse3200.game.ui.UIComponent
skin, stage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Initializes button displaycom.badlogic.gdx.scenes.scene2d.ui.Table
Creates the buttoncom.badlogic.gdx.scenes.scene2d.ui.Table
Creates keybinds table menucom.badlogic.gdx.scenes.scene2d.ui.Table
Creates the keybinds menu textvoid
dispose()
Removes the buttonvoid
draw
(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draws the button on the screen.com.badlogic.gdx.scenes.scene2d.Stage
getStage()
Gets the state of the buttonvoid
setButtonTable
(com.badlogic.gdx.scenes.scene2d.ui.Table table) void
setKeybindsMenuTexture
(com.badlogic.gdx.graphics.Texture keybindsMenuTexture) void
setMenuTable
(com.badlogic.gdx.scenes.scene2d.ui.Table table) void
setStage
(com.badlogic.gdx.scenes.scene2d.Stage stage) Set the stagevoid
setTextTable
(com.badlogic.gdx.scenes.scene2d.ui.Table table) void
showKeybinds
(boolean isPressed) Toggles the visibility of the keybinds menuMethods inherited from class com.csse3200.game.ui.UIComponent
getLayer, getZIndex
Methods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, render
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.csse3200.game.rendering.Renderable
render
-
Constructor Details
-
KeybindsButtonDisplay
public KeybindsButtonDisplay(com.badlogic.gdx.scenes.scene2d.ui.Skin skin) -
KeybindsButtonDisplay
public KeybindsButtonDisplay()
-
-
Method Details
-
create
public void create()Initializes button display- Overrides:
create
in classUIComponent
-
createKeybindsMenu
public com.badlogic.gdx.scenes.scene2d.ui.Table createKeybindsMenu()Creates keybinds table menu- Returns:
- the keybinds menu table
-
showKeybinds
public void showKeybinds(boolean isPressed) Toggles the visibility of the keybinds menu- Parameters:
isPressed
- keybinds button is pressed
-
createButtonTable
public com.badlogic.gdx.scenes.scene2d.ui.Table createButtonTable()Creates the button- Returns:
- the keybinds button
-
createKeybindsText
public com.badlogic.gdx.scenes.scene2d.ui.Table createKeybindsText()Creates the keybinds menu text- Returns:
- the keybinds menu text
-
dispose
public void dispose()Removes the button- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in classRenderComponent
-
draw
public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draws the button on the screen. The actual rendering is handled by the stage, so this method is empty.- Specified by:
draw
in classRenderComponent
- Parameters:
batch
- Batch to render to.
-
getStage
public com.badlogic.gdx.scenes.scene2d.Stage getStage()Gets the state of the button- Returns:
- the stage
-
setStage
public void setStage(com.badlogic.gdx.scenes.scene2d.Stage stage) Set the stage- Parameters:
stage
- the stage
-
setKeybindsMenuTexture
public void setKeybindsMenuTexture(com.badlogic.gdx.graphics.Texture keybindsMenuTexture) -
setButtonTable
public void setButtonTable(com.badlogic.gdx.scenes.scene2d.ui.Table table) -
setMenuTable
public void setMenuTable(com.badlogic.gdx.scenes.scene2d.ui.Table table) -
setTextTable
public void setTextTable(com.badlogic.gdx.scenes.scene2d.ui.Table table)
-