Class TileRenderer
java.lang.Object
dev.prozilla.pine.core.component.Component
dev.prozilla.pine.core.component.sprite.TileRenderer
- All Implemented Interfaces:
Lifecycle
,Printable
,ApplicationContext
,ApplicationProvider
,ComponentsContext
,ComponentsProvider
,TileProvider
,EntityContext
,EntityProvider
,SceneContext
,SceneProvider
A component for rendering 2D square tiles in the world.
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
Width and height of the tile, in pixels. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetGroup()
getName()
getTile()
boolean
void
moveBy
(int x, int y) Moves this tile by an x and y amount.void
Moves this tile by an x and y amount based on a coordinateboolean
moveTo
(int x, int y) Moves this tile to an XY-coordinate.boolean
Moves this tile to a coordinate.void
remove()
Removes this tile from its grid.void
setCoordinate
(Vector2i coordinate) void
setSize
(int size) 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, 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
Methods inherited from interface dev.prozilla.pine.core.component.sprite.TileProvider
getEntity, getTransform
-
Field Details
-
size
public int sizeWidth and height of the tile, in pixels. -
group
-
-
Constructor Details
-
TileRenderer
-
-
Method Details
-
getName
-
moveBy
Description copied from interface:TileProvider
Moves this tile by an x and y amount based on a coordinate- Specified by:
moveBy
in interfaceTileProvider
- Parameters:
coordinate
- Coordinate
-
moveBy
public void moveBy(int x, int y) Description copied from interface:TileProvider
Moves this tile by an x and y amount.- Specified by:
moveBy
in interfaceTileProvider
- Parameters:
x
- X valuey
- Y value
-
moveTo
public boolean moveTo(int x, int y) Description copied from interface:TileProvider
Moves this tile to an XY-coordinate.- Specified by:
moveTo
in interfaceTileProvider
- Parameters:
x
- X valuey
- Y value- Returns:
- True if the coordinate of this tile was changed.
-
moveTo
Description copied from interface:TileProvider
Moves this tile to a coordinate.- Specified by:
moveTo
in interfaceTileProvider
- Parameters:
coordinate
- Coordinate- Returns:
- True if the coordinate of this tile was changed.
-
setCoordinate
- Specified by:
setCoordinate
in interfaceTileProvider
-
getCoordinate
- Specified by:
getCoordinate
in interfaceTileProvider
-
setSize
public void setSize(int size) - Specified by:
setSize
in interfaceTileProvider
-
isHovering
public boolean isHovering()- Specified by:
isHovering
in interfaceTileProvider
-
remove
public void remove()Description copied from interface:TileProvider
Removes this tile from its grid.- Specified by:
remove
in interfaceTileProvider
-
getGroup
- Specified by:
getGroup
in interfaceTileProvider
- Returns:
- The grid this tile belongs to, or
null
if this tile is not in a grid.
-
getTile
- Specified by:
getTile
in interfaceTileProvider
-