Question

I'm building a simple drawing app using the new Meteor.js app platform and paper.js. I'd like to have users be able to draw paths, and then have them autosaved to Mongo in 'real-time'. Specifically, when the user stops dragging the mouse. These paths should appear on other client screens right away; standard OP in Meteor anyway.

I've stored the paper.js paths as uncompressed strings using .toSource, which is fine because the system is only built for one user (me), but when the objects get loaded again, paper.js doesn't recognize them.

I'm sure there is a 'right' way to do this. I basically just need a command that adds the path objects, already created, to the current paper.js project.

Help!

Was it helpful?

Solution

You need the observe handler. You will define functions for added/changed/removed events, and these functions will modify the drawing accordingly. If you get stuck with the observe methods point me toward your code and I'll help you out.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top