Canvas 旋转180度后,导致 touch.getLocation() 的Y坐标相反,怎么处理才好

Canvas 旋转180度后,导致 touch.getLocation() 的Y坐标相反,怎么处理才好

cc.find(“Canvas”).angle = 180;

导致 move事件中,获得的坐标不对

@jare

@jare

求救求救

@jare

请问你是在哪个版本测试的这个问题。

2.1.0

2.1.0

我这边测试没有问题,麻烦你给我一个demo

我的旋转是这样写的
cc.find(“Canvas”).angle = 180;
cc.find(“Canvas”).scaleX = -1;
cc.find(“Canvas”).scaleY = -1;

请问大神你是怎样屏幕旋转180的?

@jare

你好,可以使用cc.view._convertTouchesWithScale()这个接口,
他可以帮助你转变翻转后的touch对象。

好的,我试试哈 大神

@337031709 不知道怎么写 _convertTouchesWithScale
能不能写下参考的api?

@337031709 cc.view._convertTouchesWithScale() 这个不知道怎么应用 转换touch?

求救,不知道怎么使用这个接口,没有api ,不知道怎么用转换touch

取到canvas的node,吧nodescaleX=-1,node.scaleY=-1,其他什么都不用做试试

我也这样操作了,但是touch的getLocation并没有变化啊?
你能否给我一个demo?

楼主解决了吗。我在2.3.2上也遇到这个问题