node相关的坐标转换方法都没有了,怎么回事?
放在UITransfrom组件了
1赞
this.node.getComponent(UITransform).convertToNodeSpaceAR(pos, pos)这样使用吗?我用这个方式转换不能适配不同屏幕,坐标会偏移
兄弟解决了吗? 我现在也是这样
请问解决了么?用的3.2的,这个方法怎么替换啊,用UITransform不管用
如果要转换的坐标是触摸点的话,要注意的是通过 getLocation 获取的还是 getUILocation 来获取的,然后坐标转换是通过节点上的 UITransform 的 convertToNodeSpaceAR 来转换的
this.node.getComponent(UITransform).convertToNodeSpaceAR( event.getLocation() ) 转换出来的坐标全部是Vec3 {x: NaN, y: NaN, z: NaN} ,这是为啥, cocos creator3.5版本?