cc.pDistance is deprecated

cc.pDistance is deprecated
0
#1

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.

@jare @slackmoehrle

#2

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();
#3

Thanks. it has been resolved.

closed #4

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.