Class Brush

java.lang.Object
group24.escaperoom.ui.editorTools.EditorTool
group24.escaperoom.ui.editorTools.Brush
Direct Known Subclasses:
ItemBrush

public abstract class Brush extends EditorTool
Base class for Brushes
  • Constructor Details

    • Brush

      public Brush(LevelEditorScreen editor)
      Parameters:
      editor - on which this brush will operate
  • Method Details

    • select

      public void select()
      Description copied from class: EditorTool
      Called when this tool is selected
      Specified by:
      select in class EditorTool
    • cancel

      public void cancel()
      Description copied from class: EditorTool
      Called when the user presses Escape while this is the active tool
      Specified by:
      cancel in class EditorTool
    • draw

      public abstract Optional<Item> draw(int x, int y)
      Parameters:
      x - coord in game units where this brush should draw
      y - coord in game units where this brush should draw
      Returns:
      the newly drawn item
    • handleTouchDown

      public abstract boolean handleTouchDown(float x, float y)
      Parameters:
      x - touchdown coord
      y - touchdown coord
      Returns:
      whether the brush is handling this event
    • handleTouchUp

      public abstract void handleTouchUp()
      Handle a touchup event
    • handleDrag

      public abstract void handleDrag(float x, float y)
      Parameters:
      x - drag coord
      y - drag coord
    • getItem

      public abstract Item getItem()
      Returns:
      item that is drawn with this brush
    • isDrawing

      public abstract boolean isDrawing()
      Returns:
      whether this brush is currently drawing
    • getType

      public ToolManager.ToolType getType()
      Specified by:
      getType in class EditorTool
      Returns:
      the ToolManager.ToolType