The Overlap component allows a Game Object to check if it overlaps with the bounds of another Game Object.
Checks to see if the bounds of this Game Object overlaps with the bounds of the given Display Object, which can be a Sprite, Image, TileSprite or anything that extends those such as Button or provides a
getBoundsmethod and result.
This check ignores the
hitAreaproperty if set and runs a
getBoundscomparison on both objects to determine the result.
Therefore it's relatively expensive to use in large quantities, i.e. with lots of Sprites at a high frequency. It should be fine for low-volume testing where physics isn't required.
Name Type Description
Phaser.Sprite | Phaser.Image | Phaser.TileSprite | Phaser.Button | PIXI.DisplayObject
The display object to check against.
True if the bounds of this Game Object intersects at any point with the bounds of the given display object.