Bounds.contains
Jump to navigation
Jump to search
Bounds.contains
returns true (1) if the given coordinates are within the bounds, and false (0) if they are outside the bounds.
Arguments
Parameter Name | Type | Default Value | Meaning |
---|---|---|---|
x | number | 0 | horizontal position |
y | number | 0 | vertical position |
Usage Notes
The coordinate system is undefined, but the parameters are assumed to be in the same coordinate system as the bounds itself. So for example, if using this with Sprite.localBounds, then x
and y
should be coordinates local to the sprite. But if using it with Sprite.worldBounds, then x
and y
should be relative to the sprite display itself.