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 TypeMethodDescriptionvoidcreate()Initializes button displaycom.badlogic.gdx.scenes.scene2d.ui.TableCreates the buttoncom.badlogic.gdx.scenes.scene2d.ui.TableCreates keybinds table menucom.badlogic.gdx.scenes.scene2d.ui.TableCreates the keybinds menu textvoiddispose()Removes the buttonvoiddraw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draws the button on the screen.com.badlogic.gdx.scenes.scene2d.StagegetStage()Gets the state of the buttonvoidsetButtonTable(com.badlogic.gdx.scenes.scene2d.ui.Table table) voidsetKeybindsMenuTexture(com.badlogic.gdx.graphics.Texture keybindsMenuTexture) voidsetMenuTable(com.badlogic.gdx.scenes.scene2d.ui.Table table) voidsetStage(com.badlogic.gdx.scenes.scene2d.Stage stage) Set the stagevoidsetTextTable(com.badlogic.gdx.scenes.scene2d.ui.Table table) voidshowKeybinds(boolean isPressed) Toggles the visibility of the keybinds menuMethods inherited from class com.csse3200.game.ui.UIComponent
getLayer, getZIndexMethods inherited from class com.csse3200.game.rendering.RenderComponent
compareTo, renderMethods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods 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:
createin 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:
disposein interfacecom.badlogic.gdx.utils.Disposable- Overrides:
disposein 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:
drawin 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)
-