I've run into this several times trying to use and understand other people's code. Since the code was posted, I assume it used to work, but won't now. What does this mean and how can I fix it?
/**
* a very light wrapper around a PImage that tracks the mouse
*/
class MouseImage {
PImage img;
MouseImage(String filename) {
img = loadImage(filename);
}
void draw() {
translate(mouseX-img.width/2f, mouseY-img.height/2f, 0.1f);
image(img, 0, 0);
}
}
/**
* a very light wrapper around a PImage that tracks the mouse
*/
class MouseImage {
PImage img;
MouseImage(String filename) {
img = loadImage(filename);
}
void draw() {
translate(mouseX-img.width/2f, mouseY-img.height/2f, 0.1f);
image(img, 0, 0);
}
}
1