1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

State Documentation Suggestion

Posted by Bill Mill on Dec 14, 2008

It seems to me that the state tutorial should be clearer that push() and pop() do not affect the color, fill, and stroke state.

From the documentation there, I would guess that:

fill(1,0,0)
rect(20, 20, 40, 40)
push()
fill(0)
rotate(45)
rect(120, 20, 40, 40)
pop()
rect(220, 20, 40, 40)
Would produce red, black, and red rectangles. Of course, it produces red, black and black rectangles.


 
Posted by Bill Mill on Dec 16, 2008

In particular, this line:

> Once you call the push() command, all subsequent state commands are valid until you call pop() in your script. Then the state reverts to how things where before push(). This way you can transform groups of elements that need to stay together.

is incorrect, since you defined state commands above that to include color, fill, stroke, linewidth, etc.

If you would like me to help improve the page instead of just suggesting things, let me know and I'll submit a diff.



Posted by Tom De Smedt on Dec 18, 2008

Thanks Bill.
I've clarified the documentation for push() and pop() a bit. If you want I can provide you a login to the NodeBox website so you can edit documentation and tutorials.