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 ClassesModifier and TypeInterfaceDescriptionstatic interfaceWhat a layer paints on.static enumFor whom a layer is painted. -
Method Summary
Modifier and TypeMethodDescriptionvoidpaint(MapLayer.Context context) Paints the layer.intReturns how many ticks apart repaints happen;0only repaints onMapView.repaint()and, for a per-viewer layer, when someone starts seeing the map.scope()Returns for whom the layer is painted.
-
Method Details
-
paint
Paints the layer.- Parameters:
context- where to paint, and for whom- Since:
- 0.1.0
-
scope
MapLayer.Scope 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;0only repaints onMapView.repaint()and, for a per-viewer layer, when someone starts seeing the map.- Returns:
- how many ticks apart repaints happen;
0only repaints onMapView.repaint()and, for a per-viewer layer, when someone starts seeing the map - Since:
- 0.1.0
-