We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to do a loading bar in p5.js where I have a bar on the top like YouTube loading bar.
like so
var x = 0;
function setup() {
createCanvas(400, 400);
x = width;
}
function draw() {
background(220);
stroke(255,0,0);
strokeWeight(10);
line(0,0,x,0);
}
I want to use the map()
function where I can reduce the width of the line.
map(x, 0 , width , second(),second()+5);
This is not working,can someone tell me how can I achieve this?
Answers
Please link between crossposts, so people don't waste their time giving you advice you've already received.
This question already has an answer here: https://stackoverflow.com/questions/47910247/executing-a-function-for-5-seconds
This question has already been answered here
https://stackoverflow.com/questions/47910247/executing-a-function-for-5-seconds?noredirect=1#47910935