KineticJs:拼图不显示整个图像?

时间:2014-08-21 06:24:13

标签: javascript html5 kineticjs puzzle

目前我在使用我的拼图和"点击"显示我的整个图像时出现问题。旋转它有一个错误,当我点击一块其他一块也旋转为什么?任何人都可以帮助我看到我的小提琴并帮助我吗?非常感谢

    fillPatternImage:imageObj,
                    x:-pieceWidth*i,
                    y:-pieceHeight*j,
                    stroke: "#000000",
                    strokeWidth: 4,
                    lineCap: "round",
                    rotation : Math.PI * 0.5 * Math.floor(Math.random() * 4),
                    draggable: true,
                    offset: [pieceWidth/2,pieceHeight/2],
                x: pieceWidth*i+pieceWidth/2 + (Math.random()*2)*((stage.getWidth()+pieceWidth)/20),
                y: pieceHeight*j+pieceHeight/2 + (Math.random()*2)*((stage.getHeight()+pieceHeight)/20),
            });
            piecesArray[i][j].shape.on("mousedown", function(){
                this.moveToTop();
                });
            piecesArray[i][j].shape.on("click", function(){
                this.moveToTop();
                this.rotateDeg(90)
                });   

我的JsFiddle:http://jsfiddle.net/e70n2693/

由于

1 个答案:

答案 0 :(得分:0)

piecesArray[i][j].shape.on("click", function(){
    this.moveToTop();
    this.rotateDeg(90)
    layer.draw();
});

http://jsfiddle.net/e70n2693/2/

相关问题