In the new version objects do not morph themselves anymore. There is no morph method. Instead all morphables have a to method which returns a new Morphable. This returned object manages the morph. It has an at function to give back a morphed value.
To be morphable, an object needs to implement the method toArray. Beside that, it has to have an init method which at least accepts an array as input.
Morphables are:
SVGArray
PathArray
PointArray
SVGNumber
Color
Box
Matrix
TransformBag (used to morph transform parameters)
ObjectBag (used to morph other objects - not used in the library but user might need it?)
NonMorphable (basically something which cant be morphed (like a string)). Its used whenever no type for morphing can be found
Morphable.js extends all Morphable types with a fromArray method and the to method.
In the new version objects do not morph themselves anymore. There is no
morph
method. Instead all morphables have ato
method which returns a newMorphable
. This returned object manages the morph. It has anat
function to give back a morphed value.To be morphable, an object needs to implement the method
toArray
. Beside that, it has to have aninit
method which at least accepts an array as input.Morphables are:
Morphable.js extends all Morphable types with a
fromArray
method and theto
method.