-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
Hi guys !
This is my code:
var s1 = function( sketch ) {
sketch.setup = function() {
let canvas1 = sketch.createCanvas(400, 400, sketch.WEBGL);
canvas1.position(0,0);
canvas1.background("blue");
}
sketch.mousePressed = function(){
sketch.beginShape();
sketch.fill("green");
}
sketch.mouseDragged = function(){
sketch.curveVertex(sketch.mouseX-200,sketch.mouseY-200);
}
sketch.mouseReleased = function(){
sketch.endShape();
}
};
new p5(s1);
var s2 = function( sketch ) {
sketch.setup = function() {
var canvas1 = sketch.createCanvas(400, 400, sketch.WEBGL);
canvas1.position(400,0);
canvas1.background(0,0,0,0);
}
sketch.mousePressed = function(){
sketch.beginShape();
sketch.fill("yellow");
}
sketch.draw = function(){
sketch.curveVertex(sketch.mouseX-205,sketch.mouseY-200);
sketch.endShape();
}
sketch.mouseReleased = function(){
}
};
// create the second instance of p5 and pass in the function for sketch 2
new p5(s2);
the EndShape call doesn't work. I think it should, is this a bug ?