Shows how to add an interactive compass UI to the map.
To test the compass you can rotate the map via a and d.
Check out the SimpleCompassApp.java.
To add a compass you only need the compass object
CompassUI compass;
initialize it in your setup()
compass = new CompassUI(this,map);
and draw it in your draw()
compass.draw();
Thats it, easy peasy.
We have also a more complex constructor for you, to make various changes like display a custom compass image. ComplexCompassApp.java
public CompassUI(PApplet p, AbstractMapDisplay mapDisplay, PImage img, float x, float y)
To change the compass image you need to initialize a new PImage and initialize the compass with it:
PImage compassImg = loadImage("compass_grey.png");
compass = new CompassUI(this, map.mapDisplay, compassImg, 700, 100, 1);