Controls if the Sprite is allowed to be dragged horizontally.
Controls if the Sprite is allowed to be dragged vertically.
A region of the game world within which the sprite is restricted during drag.
A Sprite the bounds of which this sprite is restricted during drag.
If true when this Sprite is clicked or dragged it will automatically be bought to the top of the Group it is within.
Bounds Rect check for the sprite drag
Parent Sprite Bounds check for the sprite drag.
Runs a pixel perfect check against the given x/y coordinates of the Sprite this InputHandler is bound to.
Runs a pixel perfect check against the given x/y coordinates of the Sprite this InputHandler is bound to. It compares the alpha value of the pixel and if >= InputHandler.pixelPerfectAlpha it returns true.
The x coordinate to check.
The y coordinate to check.
The pointer to get the x/y coordinate from if not passed as the first two parameters.
true if there is the alpha of the pixel is >= InputHandler.pixelPerfectAlpha
Checks if the given pointer is both down and over the Sprite this InputHandler belongs to.
Checks if the given pointer is both down and over the Sprite this InputHandler belongs to. Use the fastTest flag is to quickly check just the bounding hit area even if InputHandler.pixelPerfectOver is true.
the pointer
Force a simple hit area check even if pixelPerfectOver is true for this object?
True if the pointer is down, otherwise false.
Checks if the given pointer is over the Sprite this InputHandler belongs to.
Checks if the given pointer is over the Sprite this InputHandler belongs to. Use the fastTest flag is to quickly check just the bounding hit area even if InputHandler.pixelPerfectOver is true.
the pointer
Force a simple hit area check even if pixelPerfectOver is true for this object?
true or false
Clean up memory.
Stops this sprite from being able to be dragged.
Stops this sprite from being able to be dragged. If it is currently the target of an active drag it will be stopped immediately; also disables any set callbacks.
Stops the sprite from snapping to a grid during drag or release.
If the pointer is currently over this Sprite this returns how long it has been there for in milliseconds.
If the pointer is currently over this Sprite this returns how long it has been there for in milliseconds.
the optional pointer ID
The number of milliseconds the pointer has been pressed down on the Sprite, or -1 if not over.
A Point object containing the coordinates of the Pointer when it was first pressed down onto this Sprite.
The distance, in pixels, the pointer has to move while being held down, before the Sprite thinks it is being dragged.
Is the Sprite dragged from its center, or the point at which the Pointer was pressed down upon it?
The offset from the Sprites position that dragging takes place from.
The Point from which the most recent drag started from.
The Point from which the most recent drag started from. Useful if you need to return an object to its starting position.
If enabled, when the Sprite stops being dragged, it will only dispatch the onDragStop event,
and not the onInputUp
event.
If enabled, when the Sprite stops being dragged, it will only dispatch the onDragStop event,
and not the onInputUp
event. If set to false
it will dispatch both events.
The amount of time, in ms, the pointer has to be held down over the Sprite before it thinks it is being dragged.
Is this sprite allowed to be dragged by the mouse? true = yes, false = no
Allow this Sprite to be dragged by any valid pointer.
Allow this Sprite to be dragged by any valid pointer. When the drag begins the Sprite.events.onDragStart event will be dispatched. When the drag completes by way of the user letting go of the pointer that was dragging the sprite, the Sprite.events.onDragStop event is dispatched.
You can control the thresholds over when a drag starts via the properties: Pointer.dragDistanceThreshold the distance, in pixels, that the pointer has to move before the drag will start. Pointer.dragTimeThreshold the time, in ms, that the pointer must be held down on the Sprite before the drag will start. You can set either (or both) of these properties after enabling a Sprite for drag. For the duration of the drag the Sprite.events.onDragUpdate event is dispatched. This event is only dispatched when the pointer actually changes position and moves. The event sends 5 parameters: sprite, pointer, dragX, dragY and snapPoint.
If false the Sprite will drag from where you click it minus the dragOffset. If true it will center itself to the tip of the mouse pointer.
If true the Sprite will be bought to the top of the rendering list in its current Group.
If true it will use a pixel perfect test to see if you clicked the Sprite. False uses the bounding box.
If using pixel perfect collision this specifies the alpha level from 0 to 255 above which a collision is processed.
If you want to restrict the drag of this sprite to a specific Rectangle, pass the Phaser.Rectangle here, otherwise it's free to drag anywhere.
If you want to restrict the drag of this sprite to within the bounding box of another sprite, pass it here.
Make this Sprite snap to the given grid either during drag or when it's released.
Make this Sprite snap to the given grid either during drag or when it's released. For example 16x16 as the snapX and snapY would make the sprite snap to every 16 pixels.
The width of the grid cell to snap to.
The height of the grid cell to snap to.
If true the sprite will snap to the grid while being dragged.
If true the sprite will snap to the grid when released.
Used to offset the top-left starting point of the snap grid.
Used to offset the top-left starting point of the snap grid.
If enabled the Input Handler will process input requests and monitor pointer activity.
A reference to the currently running game.
Warning: EXPERIMENTAL
Warning: EXPERIMENTAL
TODO
Returns true if the Sprite is being currently dragged.
Is this object using pixel perfect checking?
Is this object using pixel perfect checking?
True if the this InputHandler has either pixelPerfectClick
or pixelPerfectOver
set to true.
Returns true if the pointer has left the Sprite within the specified delay time (defaults to 500ms, half a second)
Returns true if the pointer has left the Sprite within the specified delay time (defaults to 500ms, half a second)
the given pointer ID
The time below which the pointer is considered as just out.
true or false
The alpha tolerance threshold.
The alpha tolerance threshold. If the alpha value of the pixel matches or is above this value, it's considered a hit.
Set to true to use pixel perfect hit detection when checking if the pointer is over this Sprite when it's clicked or touched.
Set to true to use pixel perfect hit detection when checking if the pointer is over this Sprite when it's clicked or touched. The x/y coordinates of the pointer are tested against the image in combination with the InputHandler.pixelPerfectAlpha value. This feature only works for display objects with image based textures such as Sprites. It won't work on BitmapText or Rope.
Warning: This is expensive so only enable if you really need it. Use a pixel perfect check when testing for clicks or touches on the Sprite.
Set to true to use pixel perfect hit detection when checking if the pointer is over this Sprite.
Set to true to use pixel perfect hit detection when checking if the pointer is over this Sprite. The x/y coordinates of the pointer are tested against the image in combination with the InputHandler.pixelPerfectAlpha value. This feature only works for display objects with image based textures such as Sprites. It won't work on BitmapText or Rope.
Warning: This is expensive, especially on mobile (where it's not even needed!) so only enable if required. Also see the less-expensive InputHandler.pixelPerfectClick. Use a pixel perfect check when testing for pointer over.
The priorityID is used to determine which game objects should get priority when input events occur.
The priorityID is used to determine which game objects should get priority when input events occur. For example if you have several Sprites that overlap, by default the one at the top of the display list is given priority for input events. You can stop this from happening by controlling the priorityID value. The higher the value, the more important they are considered to the Input events.
EXPERIMENTAL: Please do not use this property unless you know what it does.
EXPERIMENTAL: Please do not use this property unless you know what it does. Likely to change in the future.
A Point object that contains by how far the Sprite snap is offset.
This defines the top-left X coordinate of the snap grid.
This defines the top-left Y coordinate of the snap grid.
When the Sprite is dragged this controls if the center of the Sprite will snap to the pointer on drag or not.
When the Sprite is dragged this controls if the Sprite will be snapped on release.
If the sprite is set to snap while dragging this holds the point of the most recent 'snap' event.
When a Sprite has snapping enabled this holds the width of the snap grid.
When a Sprite has snapping enabled this holds the height of the snap grid.
On a desktop browser you can set the 'hand' cursor to appear when moving over the Sprite.
The Input Handler is bound to a specific Sprite and is responsible for managing all Input events on that Sprite.
http://phaser.io/docs/2.6.2/Phaser.InputHandler.html