Search code examples
javascriptpaperjs

Interacting with paper.js paperscript from Javascript?


Looking for a graphics library to make an online HTML game with Socket.IO. Can you manipulate a "paperscript" context from regular JavaScript? I've been reading the paper.js documentation and see nothing about sending data to a paperscript. Is a paperscript a closed program that is separate from JS?

I did read that paperscript can be used directly from JS, but this seems to be a messy / cumbersome solution.


Solution

  • Using paper.js directly in javascript is really simple, the only important thing you loose is the operator overloads (you must write PointA.add(PointB) instead of PointA + PointB). I have used it a lot in pure JS and never had a problem.

    Here is the article which explains the differences between paperscript and javascript.