我试图在KineticJS中模拟这个可拖动图像的附加特性,但我无法完成它。
小提琴:http://jsfiddle.net/dekaa/6L1wxt1g/
shape = new Kinetic.Shape({
sceneFunc:function(ctx){
ctx.drawImage(clipping_mask,0,0);
ctx.globalCompositeOperation = "source-in";
ctx.drawImage(main_image,0,0);
},
draggable:true
});尝试使用sceneFunc函数时,当我使用它时,可拖动的特性不起作用。所以问题是,它能在KineticJS中完成吗?
发布于 2014-10-01 12:02:58
ctx参数不是本机上下文。
ctx.drawImage(clipping_mask,0,0);
ctx.setAttr('globalCompositeOperation',"source-in");
ctx.drawImage(main_image,0,0);http://jsfiddle.net/6L1wxt1g/1/
https://stackoverflow.com/questions/26139341
复制相似问题