p5.js - won't draw texture in quad?


Trying to draw a second image inside a quad. Working perfect in processing but not in p5.

preload and setup done:

createCanvas(1135, 720, P2D);

function draw() {

  image(img, 0, 0); // --- first image appears at front

  texture(imgBack); // --- second image appears inside the quad window

  quad( mouseX, mouseY,
        mouseX + windowsizeX, mouseY,
        mouseX + windowsizeX, mouseY + windowsizeY,
        mouseX, mouseY + windowsizeY );


  • My problem is that in processing second image appears fixed at the background, , like I wanted, as if it was part of the background and the quad windows act like a transparency window over the front image. With p5 doesn't work like that. Second image automatic scale down to quad size...

Sign In or Register to comment.