Class GridGroup
java.lang.Object
dev.prozilla.pine.core.component.Component
dev.prozilla.pine.core.component.sprite.GridGroup
- All Implemented Interfaces:
Lifecycle
,Printable
,ApplicationContext
,ApplicationProvider
,ComponentsContext
,ComponentsProvider
,EntityContext
,EntityProvider
,SceneContext
,SceneProvider
A component that groups 2D tiles together and aligns them in a grid pattern.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddTile
(TileRenderer tile) Adds a tile to this grid based on the tile's current coordinate.addTile
(TilePrefab tilePrefab, int x, int y) addTile
(TilePrefab tilePrefab, Vector2i coordinate) coordinateToPosition
(int x, int y) coordinateToPosition
(Vector2i coordinate) boolean
destroyTile
(Vector2i coordinate) boolean
destroyTile
(TileRenderer tile) boolean
destroyTile
(Entity entity) getName()
getTile
(int x, int y) boolean
hasTile
(int x, int y) boolean
boolean
isHovering
(TileRenderer tile) boolean
isHovering
(Entity entity) void
positionToCoordinate
(float x, float y) positionToCoordinate
(Vector2f position) boolean
removeTile
(Vector2i coordinate) boolean
removeTile
(TileRenderer tile) boolean
removeTile
(Entity entity) Methods inherited from class dev.prozilla.pine.core.component.Component
equals, getApplication, getEntity, getScene, hashCode, setActive, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface dev.prozilla.pine.core.ApplicationProvider
getConfig, getInput, getLogger, getModManager, getRenderer, getTimer, getTracker, getWindow
Methods inherited from interface dev.prozilla.pine.core.component.ComponentsProvider
getComponent, getComponentInParent, getComponentInParent, getComponents, getComponentsInChildren
Methods inherited from interface dev.prozilla.pine.core.entity.EntityContext
isDescendantOf
Methods inherited from interface dev.prozilla.pine.core.entity.EntityProvider
getChildWithTag, getFirstChild, getLastChild, getParentWithTag, getTransform, isDescendantOf
Methods inherited from interface dev.prozilla.pine.common.Lifecycle
destroy, init, init, input, input, render, render, start, update, update
Methods inherited from interface dev.prozilla.pine.core.scene.SceneProvider
getCameraData, getWorld
-
Field Details
-
size
public int size -
coordinateToTile
-
hoveringTile
-
-
Constructor Details
-
GridGroup
public GridGroup(int size)
-
-
Method Details
-
getName
-
addTile
-
addTile
-
addTile
-
addTile
-
addTile
Adds a tile to this grid based on the tile's current coordinate.- Parameters:
tile
- Tile to add to this grid- Throws:
IllegalStateException
- If there is already a tile in this grid with the same coordinateNullPointerException
-
destroyTile
-
destroyTile
-
destroyTile
-
removeTile
-
removeTile
-
removeTile
-
hasTile
public boolean hasTile(int x, int y) -
hasTile
-
getTile
-
getTile
-
moveTile
-
isHovering
-
isHovering
-
positionToCoordinate
-
positionToCoordinate
-
coordinateToPosition
-
coordinateToPosition
-