PImage Draw transparent .jpg keeps overwriting the newest mouseY, don't know how to fix

Hi!!

Just started using Processing and I’m having a hard time with my transparent jpg… I have a code for interactive mouseY but because the background is transparant you can see the previous mouse movement (what I don’t want visible). It must be an easy fix but I don’t know how. Pls help me

PImage a;
PImage b;

void setup(){
  size (100, 100);
  background (255);
  a = loadImage ("boven-01.png");
  b = loadImage ("onder-01.png");
    
}

void draw(){
  image (a,0,0,100,mouseY);
  image (b,0,mouseX,100,height-mouseY);
}

repeat this at start of draw() ?

2 Likes

Thank you so much! works perfectly :slight_smile:

1 Like

Hello @Lott,

Lots of resources here:

Some discussion here about how background is used:
https://processing.org/tutorials/overview

Reference:
https://processing.org/reference/background_.html

:)