[]关于多点触控e.touches问题
Laya.stage.on(Laya.Event.MOUSE_DOWN, this, onCtrlMoveRockerTouchDown);
Laya.stage.on(Laya.Event.MOUSE_MOVE, this, onCtrlMoveRockerTouchDown);
function onCtrlMoveRockerTouchDown(e) {
console.log("onCtrlMoveRockerTouchDown()");
this.ctrlMoveRockerPosX = undefined;
this.ctrlMoveRockerPosY = undefined;
var tX, tY;
var ts = e.touches;
console.log(e.stageX + ":" + e.stageY);
if(ts) {
console.log("11111111111111111111");
}
else {
console.log("33333333333333333333333");
}
}
要求是 获取多个触点的坐标 然后进行一系列操作 简单说就是两个虚拟摇杆 我的方法是设变量 当触发mousemove mouseup mousedown mouseout事件的时候 检查touches的各个坐标是否在摇杆范围内 在的话 把这个坐标保存成变量 不在的话 把变量设为undefined
console.log(e.stageX + ":" + e.stageY); 句正常输出鼠标坐标
但是ts(即 e.touches)始终为undefined
请问这个是什么原因造成的
ps:本人已经研究这个问题很久 从上周四就搞不定 应该不是低级错误 而且我也详细参考了demo 请各位大神不要回复无用的话 多谢 我真的非常着急 再搞不定要被炒鱿鱼了
Laya.stage.on(Laya.Event.MOUSE_MOVE, this, onCtrlMoveRockerTouchDown);
function onCtrlMoveRockerTouchDown(e) {
console.log("onCtrlMoveRockerTouchDown()");
this.ctrlMoveRockerPosX = undefined;
this.ctrlMoveRockerPosY = undefined;
var tX, tY;
var ts = e.touches;
console.log(e.stageX + ":" + e.stageY);
if(ts) {
console.log("11111111111111111111");
}
else {
console.log("33333333333333333333333");
}
}
要求是 获取多个触点的坐标 然后进行一系列操作 简单说就是两个虚拟摇杆 我的方法是设变量 当触发mousemove mouseup mousedown mouseout事件的时候 检查touches的各个坐标是否在摇杆范围内 在的话 把这个坐标保存成变量 不在的话 把变量设为undefined
console.log(e.stageX + ":" + e.stageY); 句正常输出鼠标坐标
但是ts(即 e.touches)始终为undefined
请问这个是什么原因造成的
ps:本人已经研究这个问题很久 从上周四就搞不定 应该不是低级错误 而且我也详细参考了demo 请各位大神不要回复无用的话 多谢 我真的非常着急 再搞不定要被炒鱿鱼了
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Monica - 知识达人
赞同来自: