0
我正在嘗試使用kineticJs的拼圖遊戲。我得到了不規則的形狀部分,但源圖像不顯示或填充它。我堅持這部分。拼圖源圖像不顯示
fill:{
image:imageObj,
x:pieceWidth,
y:pieceHeight,
},
stroke: "#000000",
strokeWidth: 4,
lineCap: "round",
draggable: true
我正在嘗試使用kineticJs的拼圖遊戲。我得到了不規則的形狀部分,但源圖像不顯示或填充它。我堅持這部分。拼圖源圖像不顯示
fill:{
image:imageObj,
x:pieceWidth,
y:pieceHeight,
},
stroke: "#000000",
strokeWidth: 4,
lineCap: "round",
draggable: true
看起來你需要使用fillPatternImage
而不是fill
。
var patternPentagon = new Kinetic.RegularPolygon({
x: 220,
y: stage.height()/2,
sides: 5,
radius: 70,
fillPatternImage: images.darthVader,
fillPatternOffset: {x:-220, y:70},
stroke: 'black',
strokeWidth: 4,
draggable: true
});
你需要表現出更多的代碼,因爲我們不能告訴你在做什麼......而'填寫:{圖片:imageObj,X:pieceWidth,Y:pieceHeight,},'是無效KineticJS句法。 : - / – markE 2014-09-27 04:20:50