We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › New Library: Processing Layers
Page Index Toggle Pages: 1
New Library: Processing Layers (Read 3841 times)
New Library: Processing Layers
Nov 24th, 2009, 6:34pm
 
Hi, I have written a new library that allows layering in sketches.  By using the API, the developer can create layers (like in Photoshop, etc.) that are drawn independently of one another and layered on top of each other in the sketch.

Everything is documented at http://nootropicdesign.com/processing-layers/ and there are some interesting demonstrations of its capability.

I set up a forum for discussion here:
http://nootropicdesign.com/forum/index.php#2

I'd like this library to be added to the Libraries page at http://processing.org/reference/libraries/index.html but I'm not quite sure what category this fits into!

I hope some of you find this library useful and look forward to your feedback.
-Michael
Re: New Library: Processing Layers
Reply #1 - Nov 24th, 2009, 7:40pm
 
thats really interesting and i am trying to understand what is possible. So let me ask a question.
The benefit of using this library is the fact that i can independently decide if a layer is redrawn everyframe (using background) or not (without background).

So that makes sense when i look at the LaserCut example. We dont have to take care of the black cutting line as it is easily drawn without clearing the background. But are there any other benefits ? Why do we need more then one layer for the rest. Why one layer for smoke, sparkples, glow?

Why do we need layers in the blue ball example at all?

Anyway, this seems to be something really useful! Thank you!

Re: New Library: Processing Layers
Reply #2 - Nov 24th, 2009, 8:30pm
 
Good questions.  You understand the main benefit of not having to draw everything every frame.   This allows for animation which requires erasing everything between frames.
The laser example takes layering to an extreme by having a different layer for each component of the sketch.  You certainly would not need that much separation.  And the simple animation sketch with the blue circles does not need layering to create.  Another benefit, however, is an object-oriented approach for drawing a sketch.  Each object is responsible for drawing itself with it's own draw() method, without regard to anything else that is happening in the sketch.  I think this opens up a lot of possibility as opposed to having one large draw() method that is responsible for drawing everything and keeping track of all data structures.

Does that help?
Re: New Library: Processing Layers
Reply #3 - Jan 27th, 2010, 7:19am
 
Is there a process for getting libraries added to the list of contributed libraries?  A new batch was recently added by sojamo, but my Layers library was not included.  Am I missing something?  Thanks.
Page Index Toggle Pages: 1