Interface MapLayer


public interface MapLayer
Something a plugin paints over a MapView, without touching what the map stores.

A layer is repainted from scratch: before each paint(Context) its canvas is cleared to transparent and its icons are dropped. What it paints covers the canvas of the map and the layers added before it; transparent pixels let them show through. Nothing a layer paints is saved.

A shared layer is painted once for everyone, a per-viewer layer once for each player who sees the map, so it can show something different to each. Layers are painted off the region threads: keep them quick and do not touch the world from them.

Since:
0.1.0
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    What a layer paints on.
    static enum 
    For whom a layer is painted.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Paints the layer.
    int
    Returns how many ticks apart repaints happen; 0 only repaints on MapView.repaint() and, for a per-viewer layer, when someone starts seeing the map.
    Returns for whom the layer is painted.
  • Method Details

    • paint

      void paint(MapLayer.Context context)
      Paints the layer.
      Parameters:
      context - where to paint, and for whom
      Since:
      0.1.0
    • scope

      Returns for whom the layer is painted.
      Returns:
      for whom the layer is painted
      Since:
      0.1.0
    • repaintInterval

      int repaintInterval()
      Returns how many ticks apart repaints happen; 0 only repaints on MapView.repaint() and, for a per-viewer layer, when someone starts seeing the map.
      Returns:
      how many ticks apart repaints happen; 0 only repaints on MapView.repaint() and, for a per-viewer layer, when someone starts seeing the map
      Since:
      0.1.0