This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
functions:length2d [2017/03/15 21:19] – created korshun | functions:length2d [2017/03/17 18:13] (current) – [Example] korshun | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== length2d ====== | ====== length2d ====== | ||
+ | {{tag> | ||
'' | '' | ||
Line 12: | Line 13: | ||
length2d(3.0, | length2d(3.0, | ||
</ | </ | ||
+ | |||
+ | Show XY distance between actors: | ||
+ | < | ||
+ | int x = GetActorX(tid2) - GetActorX(tid1); | ||
+ | int y = GetActorY(tid2) - GetActorY(tid1); | ||
+ | int distance = length2d(x, y), | ||
+ | print(s:" | ||
+ | </ | ||
+ | |||
+ | <note tip>Use [[ActorDistance2D]] instead of the example code above.</ | ||
===== See also ===== | ===== See also ===== |