你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
发现
话题
全文搜索
登录
[LayaAir 1.0]移动端h5项目如何获取多点触摸的坐标
如何在项目中获取多点触摸的坐标呢?Laya.stage.mouseX是鼠标的坐标,我想知道当前屏幕上所有触摸点的坐标,期待官方的帮助,谢谢。
没有找到相关结果
已邀请:
与内容相关的链接
提交
2 个回复
158*****871
赞同来自:
Laya.stage.on(Event.MOUSE_DOWN, this, this.onMouseDown);
onMouseDown(e) {
const Event = Laya.Event;
// 手机上才有 touches 属性
let touches = e.touches;
if (touches && touches.length == 2) {
preRadian = Math.atan2(
touches[0].stageY - touches[1].stageY,
touches[0].stageX - touches[1].stageX);
Laya.stage.on(Event.MOUSE_MOVE, this, this.onMouseMove);
}
}
17
赞同来自:
同上,需要同时获取到多个触控点的坐标
要回复问题请先
登录
发起人
dennie
相关问题
请问有没有方法能够获取“鼠标是否处于按下状态”?
招聘:H5游戏开发 坐标:深圳南山
TS项目使用matter.js库无智能提示
btn 鼠标移动上去默认文本颜色是绿色,我想换成其他颜色,如何操作?
如何通过命令行工具构建和发布项目
layaAir TS项目如何引用protoBuf库?
Laya2.6.0beta 物理引擎 刚体碰撞点位置获取不正确
localToGlobal坐标转换
Animator 如何获取当前所有动画名称呢?或者所有的AnimationClip呢?
用了第三方socket类 项目在IDE上可以连接正常运行,为什么打包APK之后在手机上就连接不上socket
怎么获取对象的坐标
问题状态
最新活动:
2019-11-15 15:31
浏览:
2446
关注:
3
人
商务合作
2 个回复
158*****871
赞同来自:
onMouseDown(e) {
const Event = Laya.Event;
// 手机上才有 touches 属性
let touches = e.touches;
if (touches && touches.length == 2) {
preRadian = Math.atan2(
touches[0].stageY - touches[1].stageY,
touches[0].stageX - touches[1].stageX);
Laya.stage.on(Event.MOUSE_MOVE, this, this.onMouseMove);
}
}
17
赞同来自: