请问,我直接获取window.addEventListener(‘touchstart’, function (e) {
window.addEventListener(‘pointerdown’, function (e) {
e里面的坐标如何转化为世界坐标,或者某个节点的局部坐标;
或者从cc.internal.inputManager._preTouchPoint这个坐标,要怎么转化为世界坐标,或者某个节点的局部坐标;
谢谢
请问,我直接获取window.addEventListener(‘touchstart’, function (e) {
window.addEventListener(‘pointerdown’, function (e) {
e里面的坐标如何转化为世界坐标,或者某个节点的局部坐标;
或者从cc.internal.inputManager._preTouchPoint这个坐标,要怎么转化为世界坐标,或者某个节点的局部坐标;
谢谢
Node.convertToWorldSpaceAR
http://docs.cocos.com/creator/api/zh/classes/Node.html#converttoworldspacear
多查api啊骚年
没用的,这两个接口都不是对应window.addEventListener(‘touchstart’, function (e) 和cc.internal.inputManager._preTouchPoint坐标能转化的
window.addEventListener(‘touchstart’, function (e) 的坐标系是整个网页的最左边,连上面那些show fps按钮的区域都带上一起算的
而cc.internal.inputManager._preTouchPoint的坐标也很奇怪,好像是缩小过的,
对的,我的也是这个问题,他也没有解决,文档中,和API没有提供相关的方法,我都是看了文档才过来提问的。就是不知道屏幕坐标和世界坐标的关系