Hi,
Anyone can tell me what we can use to calculate distance between two points in cocos creator as cc.pDistance is deprecated.
Thanks in advance.
I asked @jare for this thoughts and he said all cc.Pxx operations are moved to Vec.
https://docs.cocos2d-x.org/creator/api/en/classes/Vec2.html#mag
Use something like:
point1.mag(point2);
or
var v = cc.v2(point1, point2);
v.mag();
Thanks. it has been resolved.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.