Package com.csse3200.game.input
Class UpgradeUIComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.input.InputComponent
com.csse3200.game.input.UpgradeUIComponent
- All Implemented Interfaces:
com.badlogic.gdx.input.GestureDetector.GestureListener
,com.badlogic.gdx.InputProcessor
-
Field Summary
Fields inherited from class com.csse3200.game.input.InputComponent
priority
-
Constructor Summary
ConstructorDescriptionUpgradeUIComponent
(com.badlogic.gdx.graphics.Camera camera, com.badlogic.gdx.scenes.scene2d.Stage stage) Constructor for the UpgradeUIComponent -
Method Summary
Modifier and TypeMethodDescriptionvoid
Update method for the UpgradeUIComponent, checks if the entity is disposed and removes the upgrade tablecom.badlogic.gdx.graphics.Camera
Getter for the cameracom.badlogic.gdx.scenes.scene2d.Stage
getStage()
Getter for the stageboolean
touchDown
(int screenX, int screenY, int pointer, int button) Method to handle the touch down eventMethods inherited from class com.csse3200.game.input.InputComponent
create, dispose, fling, getPriority, keyDown, keyTyped, keyUp, longPress, mouseMoved, pan, panStop, pinch, pinchStop, pinchStopHandled, scrolled, setPriority, tap, touchDown, touchDragged, touchUp, zoom
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
UpgradeUIComponent
public UpgradeUIComponent(com.badlogic.gdx.graphics.Camera camera, com.badlogic.gdx.scenes.scene2d.Stage stage) Constructor for the UpgradeUIComponent- Parameters:
camera
- the camera to be used, this is the camera that the game is rendered with
-
-
Method Details
-
getCamera
public com.badlogic.gdx.graphics.Camera getCamera()Getter for the camera- Returns:
- the camera
-
getStage
public com.badlogic.gdx.scenes.scene2d.Stage getStage()Getter for the stage- Returns:
- the stage
-
touchDown
public boolean touchDown(int screenX, int screenY, int pointer, int button) Method to handle the touch down event- Specified by:
touchDown
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
touchDown
in classInputComponent
- Parameters:
screenX
- the x coordinate of the touchscreenY
- the y coordinate of the touchpointer
- the pointerbutton
- the button- See Also:
-
InputProcessor.touchDown(int, int, int, int)
-
checkForDispose
public void checkForDispose()Update method for the UpgradeUIComponent, checks if the entity is disposed and removes the upgrade table
-