How to extend KineticJS shape

后端 未结 1 1724
情歌与酒
情歌与酒 2021-01-15 03:32

For KineticJS version 4.0.0 or less a shape extended a class and could be extended by

var MyCircle = Kinetic.Circle.extend({
    init : func         


        
1条回答
  •  伪装坚强ぢ
    2021-01-15 04:14

    Kinetic.GlobalObject became Kinetic.Global (>4.0.1), then
    Kinetic.Global is now Kinetic.Util (2013 versions), here is a solution:

    (function() {
        Kinetic.MyCircle = function(config) {
            this._initMyCircle(config);
        };
    
        Kinetic.MyCircle.prototype = {
            _initMyCircle: function(config) {
                Kinetic.Circle.call(this, config);
                },
            myFunc : function(){
            }
        };
    
      Kinetic.Util.extend(Kinetic.MyCircle, Kinetic.Circle);
    })();
    

    0 讨论(0)
提交回复
热议问题