I am making a website and I am making a text to move alone the mouse x so I create this simple JavaScript program :
var context;
function setup(){
createCanvas(displayWidth-50,displayHeight-200);
}
function draw(){
textSize(75);
fill("white");
text("Dev Rohit",mouseX , displayHeight/2);
}
The problem with this is that the text overlap each other when I move the mouse (the previous one is not disappearing) please help me solve this problem. Thanks!
Side Note : I am using p5.js library