0
大家好我是KineticJS的noob,我想知道如何更改屬性值。例如,對於在創建後一個矩形:KineticJS在創建對象後更改屬性(NOOB)
var rect = new Kinetic.Rect({
x: 239,
y: 75,
width: 100,
height: 50,
fill: "#00D2FF",
stroke: "black",
strokeWidth: 4
});
我怎麼會做這樣的事情:
rect.NewProperty({
x: 100,
y: 30,
width: 100,
height: 50,
fill: "#cccccc",
});
,並保留其他屬性不變?
感謝您的回答。所以正如我所提到的,我必須添加單詞「set」,並且所有內容都一樣嗎?例如.setWidth,.setStroke,setHeight,.setX,setY ... – Irakli 2012-08-09 12:47:36