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

writing new states?

Posted by Andrew on Aug 17, 2009

I am working on a project that requires a new type of graphics state. I know how to define functions, classes, modules, etc., but it does not seem to me that states are one of these. So my question is: how do I write new state commands?

Thank you.


 
Posted by Josh Caswell on Aug 18, 2009

I'm not completely sure what you mean by defining a new state. Do you want to keep a stack of some attribute of the drawing context, so that you can recall previous values, like push() and pop() for transforms? If it's something along those lines, take a look at this post.

If you want arrange that every object drawn to the canvas gets modified in a certain way, that may be tricky, but if you give some specifics, I'm sure one of us here can help you figure it out.