我總是得到錯誤:Kineticjs負載JSON帆布
「類型錯誤:動力學【類型】是不是構造」
「的ReferenceError:引用未定義的屬性obj.nodeType」
當我嘗試加載一個json。
json = stage.toJSON();
stage = Kinetic.Node.create(json, 'myCanvas');
方法_createNode從Kineticjs 4.3.3
var no = new Kinetic[type](obj.attrs);
在我的畫布
我有一個簡單的組
var circle1 = new Kinetic.Circle({
x: 40,
y: 50,
radius: 42,
fill: 'white',
stroke: 'black',
strokeWidth: 1,
draggable: false
});
var polygon1Tab1 = new Kinetic.RegularPolygon({
x: 40,
y: 50,
radius: 27,
sides: 4,
stroke: 'black',
strokeWidth: 4,
draggable: false
});
polygon1Tab1.rotateDeg(45);
var group1 = new Kinetic.Group({
draggable: true,
});
group1.add(circle1.clone());
group1.add(polygon1.clone());