我从尺寸宽度:26 高度:26 的 jsonObject 文件加载图像,我想将 jsonObject 文件中的图像对象居中。我试图把宽度 10 和高度 10,但它只裁剪图像从宽度:26 高度:26 到宽度:10 和高度:10,它不会将图像放在中心。
kinImages[index] = new Kinetic.Image({
image: theImage,
x: jsonObjectsLoaded[index].x,
y: jsonObjectsLoaded[index].y,
name: jsonObjectsLoaded[index].name,
width: 10,
height: 10
});