Reputation:
I'm not quite sure how to word this. I've been messing around with p5, and always come across this "error".
function setup(){
createCanvas(400,400);
}
function draw(){
textSize(32);
text(second(), 10, 30);
}
All I'm trying to do is display the second. However, what happens is that it displays the second e.g 50
, and then when second == 51
, it simply writes over the 50
. What I would prefer to happy is for the browser to display 50, delete 50, display 51, delete 51... The image below represents what is being displayed.
Upvotes: 1
Views: 1676
Reputation: 16035
In your draw
function, just draw/redraw the background as well :
function draw () {
background(90, 90, 90);
textSize(32);
text(second(), 10, 30);
}
Upvotes: 1