How do I refresh a page?

Hi all,

This is my first post, a friend recommended this forum to me. I'm working in processing and I've created a drawing tool. I have 3 issues -

1 I'd to be able to refresh my page. currently I've set it so it doesn't refresh so I can draw but I want to introduce timed refreshment for example after 30 seconds of drawing the page goes blank and starts again.

2 I'd like to introduce a maximum amount you can draw per each refreshment. E.g the page reloads every 30 seconds and each 30 seconds you have 100 ellipses you can draw, when it refreshes you have a new 100 ellipses

My code below... PImage bg;

int cNum = 1;

void setup() { // Images must be in the "data" directory to load correctly size(1200, 800); bg = loadImage("User_T_1.jpg"); strokeWeight(15); stroke(255, 100); frameRate(1000); noCursor(); mouseX = width / 2; mouseY = height / 2;

background(bg); }

void draw() { if (mousePressed == false) { //fill(0); } else { if (cNum < 50) { float r = random(5); fill(random(255), random(255), random(255)); ellipse(mouseX, mouseY, r, r);

} cNum += 1; if(cNum > 60) { cNum = 60; } } }

Answers

Sign In or Register to comment.