Class Pen

All Implemented Interfaces:
com.badlogic.gdx.InputProcessor, com.badlogic.gdx.utils.Pool.Poolable, ShortcutAdapter, Tool

public final class Pen extends EditorTool
The Pen class represents a pen tool used for drawing on a canvas. It extends the EditorTool class.
  • Constructor Details

    • Pen

      public Pen()
  • Method Details

    • validate

      public void validate()
      Description copied from interface: Tool
      Validates the current state of the tool. This method is called internally to ensure the tool is in a valid state. It performs necessary validations and updates to the tool's internal state.
      Specified by:
      validate in interface Tool
      Overrides:
      validate in class EditorTool
    • markTile

      protected void markTile(com.badlogic.gdx.math.GridPoint2 gridPoint) throws InvalidGridCellException
      Description copied from class: EditorTool
      Marks a tile on the grid based on the given grid point.
      Specified by:
      markTile in class EditorTool
      Parameters:
      gridPoint - the grid point representing the tile to be marked
      Throws:
      InvalidGridCellException - if the grid point is invalid
    • reset

      public void reset()
      Description copied from class: EditorTool
      Resets the state of the tool.

      This method is responsible for resetting the tool to its initial state by setting the canvas field to null, and clearing the lastPosition and lastGridPosition fields.

      Specified by:
      reset in interface com.badlogic.gdx.utils.Pool.Poolable
      Overrides:
      reset in class EditorTool