Pointer#swapTarget()

swapTarget(newTarget, silent)

This will change the Pointer.targetObject object to be the one provided.

This allows you to have fine-grained control over which object the Pointer is targeting.

Note that even if you set a new Target here, it is still able to be replaced by any other valid
target during the next Pointer update.

Parameters
Name Type Argument Default Description
newTarget Phaser.InputHandler

The new target for this Pointer. Note this is an InputHandler, so don't pass a Sprite, instead pass sprite.input to it.

silent boolean <optional>
false

If true the new target AND the old one will NOT dispatch their onInputOver or onInputOut events.

Source code: input/Pointer.js (Line 886)
doc_phaser
2017-02-14 11:06:17
Comments
Leave a Comment

Please login to continue.