Class ItemBrush

Direct Known Subclasses:
TiledBrush

public class ItemBrush extends Brush
  • Constructor Details

  • Method Details

    • handleTouchUp

      public void handleTouchUp()
      Description copied from class: Brush
      Handle a touchup event
      Specified by:
      handleTouchUp in class Brush
    • setItem

      public void setItem(Item item)
    • handleDrag

      public void handleDrag(float x, float y)
      Specified by:
      handleDrag in class Brush
      Parameters:
      x - drag coord
      y - drag coord
    • handleTouchDown

      public boolean handleTouchDown(float x, float y)
      Specified by:
      handleTouchDown in class Brush
      Parameters:
      x - touchdown coord
      y - touchdown coord
      Returns:
      whether the brush is handling this event
    • matchingItemAt

      protected static Optional<Item> matchingItemAt(Types.IntVector2 checkPos, Types.IntVector2 matchToPos, MapScreen editor, Item itemToMatch)
      Given some position, a MapScreen and an item to match against, return an optional of a matching item at that position.
    • placedItemAt

      protected Optional<Item> placedItemAt(Types.IntVector2 pos)
    • placeAt

      protected void placeAt(Item newItem, Types.IntVector2 newPosition)
    • getName

      public String getName()
      Specified by:
      getName in class EditorTool
    • draw

      public Optional<Item> draw(int x, int y)
      Specified by:
      draw in class Brush
      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
    • isDrawing

      public boolean isDrawing()
      Specified by:
      isDrawing in class Brush
      Returns:
      whether this brush is currently drawing
    • getItem

      public Item getItem()
      Specified by:
      getItem in class Brush
      Returns:
      item that is drawn with this brush