Class TileRenderer

java.lang.Object
dev.prozilla.pine.core.component.Component
dev.prozilla.pine.core.component.sprite.TileRenderer
All Implemented Interfaces:
Lifecycle, Printable, ComponentFinder, EntityFinder

public class TileRenderer extends Component
A component for rendering 2D square tiles in the world.
  • Field Details

    • coordinate

      public Vector2i coordinate
    • size

      public int size
      Width and height of the tile, in pixels.
    • group

      public GridGroup group
  • Constructor Details

    • TileRenderer

      public TileRenderer(Vector2i coordinate, int size)
  • Method Details

    • getName

      public String getName()
      Overrides:
      getName in class Component
    • moveBy

      public void moveBy(Vector2i coordinate)
      Moves this tile by an x and y amount based on a coordinate
      Parameters:
      coordinate - Coordinate
    • moveBy

      public void moveBy(int x, int y)
      Moves this tile by an x and y amount.
      Parameters:
      x - X value
      y - Y value
    • moveTo

      public void moveTo(int x, int y)
      Moves this tile to an XY-coordinate.
      Parameters:
      x - X value
      y - Y value
    • moveTo

      public void moveTo(Vector2i coordinate)
      Moves this tile to a coordinate.
      Parameters:
      coordinate - Coordinate
    • isHovering

      public boolean isHovering()
    • remove

      public void remove()
    • getGroup

      public GridGroup getGroup()