prisonerjohn / processing-web

0 stars 0 forks source link

[CLOSED] noStroke() can only be called between beginShape() and endShape() #98

Open prisonerjohn opened 10 years ago

prisonerjohn commented 10 years ago

Issue by gratefulfrog Saturday Apr 13, 2013 at 09:33 GMT Originally opened as https://github.com/processing/processing-web/issues/98


The 4 example on createShape() reference page is incorrect and does not work in processing 2.0b8

// Define the individual shapes and the group PShape alien, head, body;

void setup() { size(100, 100, P2D); alien = createShape(GROUP); // Make two shapes
head = createShape(ELLIPSE, 0, 0, 50, 50); head.noStroke(); body = createShape(RECT, 0, 45, 50, 40); body.fill(0); // Add the two "child" shapes to the parent group alien.addChild(body); alien.addChild(head); }

void draw() { translate(25, 10); shape(alien); // Draw the group }

prisonerjohn commented 10 years ago

Comment by REAS Saturday Apr 13, 2013 at 15:46 GMT


PShape alien, head, body;

This is the correct code. I'll update the reference. Thank you for reporting.

void setup() { size(100, 100, P2D);

// Create the shape group alien = createShape(GROUP);

// Make two shapes head = createShape(ELLIPSE, 0, 25, 50, 50); head.setFill(color(255)); body = createShape(RECT, -25, 45, 50, 40); body.setFill(color(0));

// Add the two "child" shapes to the parent group alien.addChild(body); alien.addChild(head); }

void draw() { background(204); translate(50, 15); shape(alien); // Draw the group }

prisonerjohn commented 10 years ago

Comment by gratefulfrog Saturday Apr 13, 2013 at 16:18 GMT


Thanks! I am honored that the inventor himself replied to me ;-)

There seem to be quite a few problems with using svg? createShape etc. Or maybe I'm just an idiot... I'm trying to use the Android processing while learning as I go. I'm trying to avoid having to learn all the underlying java librairies, but it's not easy.

Would you have time to discuss, maybe offline or in a forum?

gratefulfrog at g mail dot com.

Cheers, Bob

ps. Your language is great!

prisonerjohn commented 10 years ago

Comment by gratefulfrog Sunday Apr 14, 2013 at 09:34 GMT


Actually, the code proposed still doesn't work because of the window size 100x100 being too small to contain the whole "alien"...

Please correct it to read void setup() { size(100, 200, P2D);

cheers, Bob

prisonerjohn commented 10 years ago

Comment by REAS Wednesday Apr 17, 2013 at 17:05 GMT


There are some bugs now with P2D and P3D having trouble rendering 100 x 100 pixels windows. They are in the processing/processing issues. Because this new comment isn't related to the original Issue report and it's already documented as an issue, I'm going to re-close this Issue.