Mouse events on sprites such as Sprite.mouseIsOver and the related events (overridable methods) don't work if the camera is moved.
To test it you can add a camera.position.x = 500; somewhere in this example
The problem is here
https://github.com/molleindustria/p5.play/blob/master/lib/p5.play.js#L1390-L1393
The idea was: some sprites (eg GUI) may have to be drawn in the screen space ignoring the camera position and have to be triggered by the normal mouse position, however at that point in the update the camera will always be active so the sprite doesn't know if its being drawn with the camera on or off.
A fix would be to check a new property in the condition above instead of camera.active:
if(this._drawnOnCamera)
The property would be somewhat unelegantly set in the display cycle here
https://github.com/molleindustria/p5.play/blob/master/lib/p5.play.js#L1556
by adding something like this:
this._drawnOnCamera = camera.active;
I don't know if that covers all the cases though.
Here's an example that illustrates the problem and that would be fixed by this change
var s1;
var s2;
function setup() {
createCanvas(windowWidth,windowHeight);
s1 = createSprite(width/2, height/2, 200, 200);
s1.onMouseOver = function() {
this.rotation+=10;
}
s2 = createSprite(30, 30, 20, 20);
s2.onMouseOver = function() {
this.rotation+=10;
}
}
function draw() {
background("#FFFFFF");
camera.position.x++;
if(s1.mouseIsOver)
s1.shapeColor=color("#ff0000");
else
s1.shapeColor=color("#224477");
drawSprite(s1);
camera.off();
//camera is off - this sprite is drawn in the screen space like a UI
if(s2.mouseIsOver)
s2.shapeColor=color("#ff0000");
else
s2.shapeColor=color("#224477");
drawSprite(s2);
}