Interface Tool

All Known Implementing Classes:
Bucket, EditorTool, Eraser, Pen, Square

public sealed interface Tool permits EditorTool
An interface representing a tool in an editor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    draw(com.badlogic.gdx.graphics.glutils.ShapeRenderer shapeRenderer)
    Draws using the provided ShapeRenderer.
    Retrieves an instance of the Tool class with the provided Canvas.
    void
    Validates the current state of the tool.
  • Method Details

    • getInstance

      Tool getInstance(Canvas canvas)
      Retrieves an instance of the Tool class with the provided Canvas.
      Parameters:
      canvas - The Canvas object to associate with the Tool instance.
      Returns:
      The Tool instance with the provided Canvas.
    • draw

      void draw(@WillNotClose com.badlogic.gdx.graphics.glutils.ShapeRenderer shapeRenderer)
      Draws using the provided ShapeRenderer.
      Parameters:
      shapeRenderer - the ShapeRenderer object to use for drawing
    • validate

      void validate()
      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.