creater怎么获取触点坐标 求救!!

为什么event.getTouches()一直显示不存在啊 要死了。。

有大佬帮忙看看嘛

ecent.getLocation()

还是不行那

ecent.getLocation().x
ecent.getLocation().y
这样试下

不行。。。


event.getLocation()是可以获取的,你看看是不是别的什么地方有问题

啥版本?

var touches = event.getTouches();

var touch1 = touches[0], touch2 = touches[1];

touch1.getLocation()

touch2.getLocation()

1赞

好了 是这样写的 我用ts写的 它一直标红显示说不存在 但是运行的时候可以获取到 我tm真是个傻逼!!! 谢谢了

传进去的参数event 后面加个 :cc.Touch
定义下event的类型

1赞

好了 谢谢