You don't need to create SVG or DOM nodes to manipulate the shapes individually.. or use multiple canvas for each "layer".
The simplest way of doing it is using a library that already provides a "scene graph" structure ( http://en.wikipedia.org/wiki/Scene_graph ) like: http://guryjs.org/ https://github.com/kangax/fabric.js http://easeljs.com/ Or if your intention is to actually build everything from scratch a simplified description of what a scene graph should do: - store each scene element on an Array (shape, image, etc) - store the commands that draw each shape - redraw every shape on the proper order and position every time it is needed more about it: http://en.wikipedia.org/wiki/Painter%27s_algorithm for the paint bucket problem check: http://en.wikipedia.org/wiki/Flood_fill good luck. -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
