As it seems the old thread https://discourse.processing.org/t/help-rounded-rectangle-unfolding-maps-masking-maps/11050 has been deleted, I wanted to add the example code somewhere for others to use. The following code needs Unfolding Maps 0.9.92 or up (which you can find in the Github repo, or send us an e-mail.)
import de.fhpotsdam.unfolding.UnfoldingMap;
import de.fhpotsdam.unfolding.mapdisplay.OpenGLMapDisplay;
import de.fhpotsdam.unfolding.mapdisplay.shaders.MaskedMapDisplayShader;
import de.fhpotsdam.unfolding.utils.MapUtils;
UnfoldingMap map;
MaskedMapDisplayShader mapDisplayShader;
void settings() {
size(800, 800, P2D);
}
void setup() {
map = new UnfoldingMap(this);
MapUtils.createDefaultEventDispatcher(this, map);
// Use any grayscale image as mask.
PImage maskImage = loadImage("shader/mask-circular.png");
mapDisplayShader = new MaskedMapDisplayShader(this, 400, 400, maskImage);
((OpenGLMapDisplay) map.mapDisplay).setMapDisplayShader(mapDisplayShader);
}
public void draw() {
background(0);
map.draw();
}