Reference

attachImage()

Description

Attach an image to the body. Instead of using fillColor and strokeColor to draw a shape, the body will be shown as an image. The attached image must be the same size of the body in order to appear correctly.

Exemples

PImage myImage = loadImage("image1.jpg");
PPBox myBox = new PPBox(100, 50);
myBox.attachImage(myImage);
world.add(myBox);

Syntax

myBody.attachImage(image);

Parameters

image ->

PImage : the image object to be draw in order to represent this body.