Package group24.escaperoom.screens
Class MapScreen
java.lang.Object
com.badlogic.gdx.InputAdapter
com.badlogic.gdx.scenes.scene2d.Stage
group24.escaperoom.screens.AbstractScreen
group24.escaperoom.screens.MapScreen
- All Implemented Interfaces:
com.badlogic.gdx.InputProcessor,com.badlogic.gdx.Screen,com.badlogic.gdx.utils.Disposable
- Direct Known Subclasses:
GameScreen,LevelEditorScreen
-
Nested Class Summary
Nested classes/interfaces inherited from class com.badlogic.gdx.scenes.scene2d.Stage
com.badlogic.gdx.scenes.scene2d.Stage.TouchFocus -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.badlogic.gdx.graphics.g2d.Batchprotected CamManprotected Types.Sizeprotected MapMetadataprotected com.badlogic.gdx.utils.Array<Item>protected com.badlogic.gdx.scenes.scene2d.ui.Imageprotected com.badlogic.gdx.scenes.scene2d.ActorFields inherited from class group24.escaperoom.screens.AbstractScreen
fillView, followActor, inputPlex, SCREEN_HEIGHT, SCREEN_WIDTH, skin, spriteBatch, sprites, WORLD_HEIGHT, WORLD_WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidact(float delta) booleancanPlace(Item item, Types.IntVector2 newPos) static booleancanPlace(Item item, Types.IntVector2 newPos, Grid grid) booleancontainsItemWhere(Predicate<Item> predicate) voiddraw()voiddraw(boolean endBatch) findItemWhere(Predicate<Item> predicate) getGrid()getItems()getItemsAt(float x, float y) getItemsAt(int x, int y) getItemsIn(com.badlogic.gdx.math.Rectangle region) Get a list of all items present in a certain region - This returns items also partially contained in the regionintgetTileDepthOf(Item item) booleanitemIsPlaced(Item i) voidvoidmaybeAddPolling(Item item) Registers an Item for polling if it needs it.booleanPlace an item on the gridvoidremoveItemFromGrid(Item item, boolean temporary) Remove an item from the gridvoidresize(int w, int h) protected voidUpdate the room proxy on the ui stage to align with the game stage roomMethods inherited from class group24.escaperoom.screens.AbstractScreen
addInputProcessor, addPollable, addSprite, addUI, dispose, gameCoordToUI, getNotificationOverlay, getUIStage, hide, init, pause, removePollable, render, resume, show, UIcoordToGameMethods inherited from class com.badlogic.gdx.scenes.scene2d.Stage
act, actorRemoved, addAction, addActor, addCaptureListener, addListener, addTouchFocus, calculateScissors, cancelTouchFocus, cancelTouchFocus, cancelTouchFocusExcept, clear, getActionsRequestRendering, getActors, getBatch, getCamera, getDebugColor, getHeight, getKeyboardFocus, getRoot, getScrollFocus, getViewport, getWidth, hit, isDebugAll, isInsideViewport, keyDown, keyTyped, keyUp, mouseMoved, removeCaptureListener, removeListener, removeTouchFocus, screenToStageCoordinates, scrolled, setActionsRequestRendering, setDebugAll, setDebugInvisible, setDebugParentUnderMouse, setDebugTableUnderMouse, setDebugTableUnderMouse, setDebugUnderMouse, setKeyboardFocus, setRoot, setScrollFocus, setViewport, stageToScreenCoordinates, toScreenCoordinates, touchCancelled, touchDown, touchDragged, touchUp, unfocus, unfocusAll
-
Field Details
-
roomProxy
protected com.badlogic.gdx.scenes.scene2d.Actor roomProxy -
room
protected com.badlogic.gdx.scenes.scene2d.ui.Image room -
grid
-
batch
protected final com.badlogic.gdx.graphics.g2d.Batch batch -
metadata
-
gridSize
-
pollItems
-
cameraManager
-
-
Constructor Details
-
MapScreen
-
-
Method Details
-
getMetadata
-
removeItemFromGrid
Remove an item from the grid- Parameters:
temporary- whether or not this is likely a temporary removal
-
updateProxy
protected void updateProxy()Update the room proxy on the ui stage to align with the game stage room -
containsItemWhere
- Returns:
- whether or not the an item fufilling
predicateexists on the map
-
findItemWhere
- Returns:
- an
Optionalcontaining the first item fulfilling the givenpredicate
-
getItemsAt
-
getItemsAt
-
getItemsAt
- See Also:
-
getItemsIn
Get a list of all items present in a certain region - This returns items also partially contained in the region -
canPlace
- Returns:
- whether or not
itemcan be placed atnewPos
-
canPlace
- Returns:
- whether or not
itemcan be placed atnewPos
-
loadGrid
-
maybeAddPolling
Registers an Item for polling if it needs it. If called with an Item that doesn't need polling, this function does nothing. -
getItems
- Returns:
- all items associated with this map - not all these items are necessarily placed
-
placeItem
Place an item on the grid -
getGrid
-
getDrawables
-
draw
public void draw(boolean endBatch) -
draw
public void draw()- Overrides:
drawin classcom.badlogic.gdx.scenes.scene2d.Stage
-
itemIsPlaced
-
act
public void act(float delta) - Overrides:
actin classAbstractScreen
-
resize
public void resize(int w, int h) - Specified by:
resizein interfacecom.badlogic.gdx.Screen- Overrides:
resizein classAbstractScreen
-
getTileDepthOf
-