angleBetween(source, target, world) → {number}
Find the angle in radians between two display objects (like Sprites).
The optional world
argument allows you to return the result based on the Game Objects world
property,
instead of its x
and y
values. This is useful of the object has been nested inside an offset Group,
or parent Game Object.
Parameters
Name | Type | Argument | Default | Description |
---|---|---|---|---|
source | any | The Display Object to test from. | ||
target | any | The Display Object to test to. | ||
world | boolean | <optional> | false | Calculate the angle using World coordinates (true), or Object coordinates (false, the default) |
Returns
number -
The angle in radians between the source and target display objects.
- Source code: physics/arcade/World.js (Line 1996)
Please login to continue.