我使用Kinetic.Line创建了一个矩形。我想用colour填充。但它不起作用。任何人都可以帮忙吗?
var square1 = new Kinetic.Line({
x:10,
y: stage.getHeight()*0.5,
points: [0,0,0,30,30,30,30,0,0,0],
id:"object3",
fill:'green',
stroke: 'black',
strokeWidth: 2,
draggable:true,
closed: true,
dragBoundFunc: function(pos) {
return {
x: pos.x,
y: this.getAbsolutePosition().y
}
}
});