For KineticJS version 4.0.0 or less a shape extended a class and could be extended by
var MyCircle = Kinetic.Circle.extend({
init : function(config) {
this._super(config));
},
myFunc : function(){}
});
Or
Kinetic.MyCircle = function (config) {
Kinetic.Circle.apply(this, [config]);
};
Kinetic.MyCircle .prototype = {
myFunc: function () {}
};
Kinetic.GlobalObject.extend(Kinetic.MyCircle , Kinetic.Circle);
In version 4.0.1 they removed the dependencies to the class utility and implemented a custom solution that is supposed to be much faster.
How does one extend a shape with the new solution?
Kinetic.GlobalObject became Kinetic.Global (>4.0.1), then
Kinetic.Global is now Kinetic.Util (2013 versions), here is a solution: