I use the paperjs graphical objects library with Amber Smalltalk.
I want to translate the following Javascript constructors for a Point object to Amber Smalltalk
paper.Point(x, y)
paper.Point(array)
paper.Point(object)
paper.Point(size)
paper.Point(point)
The following Smalltalk
paper Point new inspect
gives a point
{ x: 0, y: 0 }
To construct an array in an Amber workspace I do
#(100 100)
The printIt is
an Array (100 100)
However
paper Point value: #(100 100)
gives nil as the result.
Question
How do I translate the paper.Point(array)
constructor from JavaScript to Amber as well as the other constructurs?
References
- http://paperjs.org/reference/point/
- https://github.com/amber-smalltalk/amber/wiki/Wrapping-javascript-constructors-recipe
- Demo of translated code so far (contains fabricjs and svg.js examples as well)