cgscenegraph中的多点触控支持

时间:2013-03-15 11:16:03

标签: javascript html5 canvas

在我遇到的所有画布库中,我发现cgscenegraph是一个非常新的库。我一直在使用kineticjs和paperjs。我想为我当前的项目尝试cgscenegraph。 cgscenegraph是否支持多点触控? 是否有关于相同的演示。无法在网站上找到任何内容。

1 个答案:

答案 0 :(得分:0)

是的,它支持:检查here

var touch = event;
//if multi-touch, get all the positions
if (event.targetTouches) { // or changedTouches
var touchPoints = (typeof event.targetTouches !== 'undefined') ? event.targetTouches : [event];
for (var i = 0; i < touchPoints.length; i++) {
touch = touchPoints[i];

positions.push(new CGSGPosition((touch.pageX - offsetX) / cgsgDisplayRatio.x,
(touch.pageY - offsetY) / cgsgDisplayRatio.y));
}
}