Package com.csse3200.game.services
Class ToggleableMap
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.RenderComponent
com.csse3200.game.ui.UIComponent
com.csse3200.game.services.ToggleableMap
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,com.badlogic.gdx.utils.Json.Serializable,Renderable,Comparable<Renderable>
-
Field Summary
Fields inherited from class com.csse3200.game.ui.UIComponent
skin, stage -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()Creates reusable ui styles and adds actors to the stage.voidCreates assets usedvoidDim the screen when the map is open (Thang: should I pause the game too?)voiddispose()Destroys the UI objectsvoiddraw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draws the actors to the game.booleaninPlayerPos(ArrayList<com.badlogic.gdx.math.GridPoint2> listPlayerPos, com.badlogic.gdx.math.GridPoint2 gpPos) Check if the given position is in the list of player's positionvoidvoidRecovers the UI components that were removed back onto the screenvoidRemoves the UI components on the screen so that cutscene is not so clutteredvoidtoggleOpen(Boolean isOpen) Toggles the map open or closed and updates the display.voidUnpauses the gameMethods 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, read, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update, writeMethods 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
-
ToggleableMap
public ToggleableMap()
-
-
Method Details
-
create
public void create()Creates reusable ui styles and adds actors to the stage.- Overrides:
createin classUIComponent
-
dimScreen
public void dimScreen()Dim the screen when the map is open (Thang: should I pause the game too?) -
toggleOpen
Toggles the map open or closed and updates the display.- Parameters:
isOpen- Whether the map is open or not.
-
inPlayerPos
public boolean inPlayerPos(ArrayList<com.badlogic.gdx.math.GridPoint2> listPlayerPos, com.badlogic.gdx.math.GridPoint2 gpPos) Check if the given position is in the list of player's position- Parameters:
listPlayerPos- list of player's positiongpPos- position to check- Returns:
- true if the given position is in the list of player's position
-
createAssets
public void createAssets()Creates assets used -
draw
public void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch) Draws the actors to the game.- Specified by:
drawin classRenderComponent- Parameters:
batch- Batch to render to.
-
pauseGame
public void pauseGame() -
unPauseGame
public void unPauseGame()Unpauses the game -
dispose
public void dispose()Destroys the UI objects- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable- Overrides:
disposein classRenderComponent
-
removeExternalUI
public void removeExternalUI()Removes the UI components on the screen so that cutscene is not so cluttered -
recoverExternalUI
public void recoverExternalUI()Recovers the UI components that were removed back onto the screen
-