Pointer#justPressed()

justPressed(duration) → {boolean}

The Pointer is considered justPressed if the time it was pressed onto the touchscreen or clicked is less than justPressedRate.
Note that calling justPressed doesn't reset the pressed status of the Pointer, it will return true for as long as the duration is valid.
If you wish to check if the Pointer was pressed down just once then see the Sprite.events.onInputDown event.

Parameters
Name Type Argument Description
duration number <optional>

The time to check against. If none given it will use InputManager.justPressedRate.

Returns
boolean -

true if the Pointer was pressed down within the duration given.

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

Please login to continue.