我有一个基于 html5 Canvas 的应用程序。我已经使用 kineticjs 库进行拖放。它有多个拖放组。如果我将画布尺寸增加到更大的尺寸,它会延迟拖动。我们如何提高拖动性能。它可以很容易地在 iPad 和平板设备上引起注意。我创建了一个示例。jsfiddle.net/MRVCg/5/embedded/result/
问问题
646 次
1 回答
0
我认为这是一个有效的问题,
http://www.html5canvastutorials.com/kineticjs/html5-canvas-shape-caching-with-kineticjs/
您应该尝试将形状缓存为图像以获得更好的性能。你可以这样做:
shape.toImage({
// define the size of the new image object
width: 100,
height: 100,
callback: function(img) {
// cache the image as a Kinetic.Image shape
var image = new Kinetic.Image({
image: img
};
}
});
于 2013-02-11T17:15:04.077 回答