Lines Not Drawing - Please Help

17 views
Skip to first unread message

Pablo Villagomez

unread,
May 7, 2018, 5:24:18 PM5/7/18
to Processing.js
Hi! Can someone tell me why are my lines not drawing? Thank you!

void setup() {
  size(1680, 1680);
  noStroke();
  for (int x = 0; x < width; x += 60) {
    fill(248, 112, 50, 250);
    rect(x, 0, 20, height);
  }
  for (int y = 20; y < width; y += 60) {
    fill(99, 159, 42, 250);
    rect(y, 0, 20, height);
  }
  for (int z = 40; z < width; z += 60) {
    fill(36, 155, 195, 250);
    rect(z, 0, 20, height);
  }
  for (int a = 420; a < 1260; a += 60) {
    fill(9, 5, 10);
    strokeWeight(15);
    strokeCap(PROJECT);
    line(a, 420, a - 20, 1000);
  }
}

Lee Brunjes

unread,
May 7, 2018, 7:54:42 PM5/7/18
to proces...@googlegroups.com
This code appears to work in my browser.


Are you getting errors in teh javascript console. (f12 in most browsers)

in particular you may run into issue with file://paths and xmlhttprequest which processing.js uses to load sketches. The easiest fix is to use a web server to host files 


-Lee



--
You received this message because you are subscribed to the Google Groups "Processing.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to processingjs+unsubscribe@googlegroups.com.
To post to this group, send email to proces...@googlegroups.com.
Visit this group at https://groups.google.com/group/processingjs.
For more options, visit https://groups.google.com/d/optout.

Pablo Villagomez

unread,
May 8, 2018, 8:31:23 AM5/8/18
to Processing.js
Thank you everyone. Parker helped me with the code. The problem was that I was using the function fill instead of the function stroke to color the lines. 
Reply all
Reply to author
Forward
0 new messages