Box2D-for-Processing
Box2D-for-Processing copied to clipboard
how to add texture to polygons?
how add a PImage to polygons shapes
Import the image/texture you want to apply to the desired polygon.
PImage img = loadImage("sample.jpg");
Then while creating the shape/polygon, use the texture() method, before defining the vertices.
begingShape(); texture(img); vertex(0,0); vertex(5,0); vertex(5,5); vertex(0,5); endShape();