Physics.Arcade#getObjectsUnderPointer()

getObjectsUnderPointer(pointer, group, callback, callbackContext) → {Array.<PIXI.DisplayObject>}

Given a Group and a Pointer this will check to see which Group children overlap with the Pointer coordinates.
Each child will be sent to the given callback for further processing.
Note that the children are not checked for depth order, but simply if they overlap the Pointer or not.

Parameters
Name Type Argument Description
pointer Phaser.Pointer

The Pointer to check.

group Phaser.Group

The Group to check.

callback function <optional>

A callback function that is called if the object overlaps with the Pointer. The callback will be sent two parameters: the Pointer and the Object that overlapped with it.

callbackContext object <optional>

The context in which to run the callback.

Returns
Array.<PIXI.DisplayObject> -

An array of the Sprites from the Group that overlapped the Pointer coordinates.

Source code: physics/arcade/World.js (Line 1599)
doc_phaser
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.