This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| functions:length2d [2017/03/15 19:22] – korshun | functions:length2d [2017/03/17 16:13] (current) – [Example] korshun | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== length2d ====== | ====== length2d ====== | ||
| - | {{tag> | + | {{tag> |
| '' | '' | ||
| Line 13: | 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 ===== | ||