- Source: src/input/typedefs/index.js (Line 7)
Namespaces
Type Definitions
-
EventData
-
A Phaser Input Event Data object.
This object is passed to the registered event listeners and allows you to stop any further propagation.
Type:
- object
- Since: 3.15.1
- Source: src/input/typedefs/EventData.js (Line 7)
Properties:
Name Type Argument Default Description cancelledboolean <optional>
false The cancelled state of this Event.
stopPropagationfunction Call this method to stop this event from passing any further down the event chain.
-
HitAreaCallback(hitArea, x, y, gameObject)
-
Parameters:
Name Type Description hitAreaany The hit area object.
xnumber The translated x coordinate of the hit test event.
ynumber The translated y coordinate of the hit test event.
gameObjectPhaser.GameObjects.GameObject The Game Object that invoked the hit test.
- Since: 3.0.0
- Source: src/input/typedefs/HitAreaCallback.js (Line 1)
Returns:
trueif the coordinates fall within the space of the hitArea, otherwisefalse.- Type
- boolean
-
InputConfiguration
-
Type:
- object
- Since: 3.0.0
- Source: src/input/typedefs/InputConfiguration.js (Line 1)
Properties:
Name Type Argument Default Description hitAreaany <optional>
The object / shape to use as the Hit Area. If not given it will try to create a Rectangle based on the texture frame.
hitAreaCallbackPhaser.Types.Input.HitAreaCallback <optional>
The callback that determines if the pointer is within the Hit Area shape or not.
draggableboolean <optional>
false If
truethe Interactive Object will be set to be draggable and emit drag events.dropZoneboolean <optional>
false If
truethe Interactive Object will be set to be a drop zone for draggable objects.useHandCursorboolean <optional>
false If
truethe Interactive Object will set thepointerhand cursor when a pointer is over it. This is a short-cut for settingcursor: 'pointer'.cursorstring <optional>
The CSS string to be used when the cursor is over this Interactive Object.
pixelPerfectboolean <optional>
false If
truethe a pixel perfect function will be set for the hit area callback. Only works with texture based Game Objects.alphaTolerancenumber <optional>
1 If
pixelPerfectis set, this is the alpha tolerance threshold value used in the callback. -
InputPluginContainer
-
Type:
- object
- Since: 3.0.0
- Source: src/input/typedefs/InputPluginContainer.js (Line 1)
Properties:
Name Type Argument Description keystring The unique name of this plugin in the input plugin cache.
pluginfunction The plugin to be stored. Should be the source object, not instantiated.
mappingstring <optional>
If this plugin is to be injected into the Input Plugin, this is the property key map used.
-
InteractiveObject
-
Type:
- object
- Since: 3.0.0
- Source: src/input/typedefs/InteractiveObject.js (Line 1)
Properties:
Name Type Argument Description gameObjectPhaser.GameObjects.GameObject The Game Object to which this Interactive Object is bound.
enabledboolean Is this Interactive Object currently enabled for input events?
alwaysEnabledboolean An Interactive Object that is 'always enabled' will receive input even if the parent object is invisible or won't render.
draggableboolean Is this Interactive Object draggable? Enable with
InputPlugin.setDraggable.dropZoneboolean Is this Interactive Object a drag-targets drop zone? Set when the object is created.
cursorboolean | string Should this Interactive Object change the cursor (via css) when over? (desktop only)
targetPhaser.GameObjects.GameObject <nullable>
An optional drop target for a draggable Interactive Object.
cameraPhaser.Cameras.Scene2D.Camera The most recent Camera to be tested against this Interactive Object.
hitAreaany The hit area for this Interactive Object. Typically a geometry shape, like a Rectangle or Circle.
hitAreaCallbackPhaser.Types.Input.HitAreaCallback The 'contains' check callback that the hit area shape will use for all hit tests.
hitAreaDebugPhaser.GameObjects.Shape If this Interactive Object has been enabled for debug, via
InputPlugin.enableDebugthen this property holds its debug shape.customHitAreaboolean Was the hitArea for this Interactive Object created based on texture size (false), or a custom shape? (true)
localXnumber The x coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.
localYnumber The y coordinate that the Pointer interacted with this object on, relative to the Game Object's top-left position.
dragState0 | 1 | 2 The current drag state of this Interactive Object. 0 = Not being dragged, 1 = being checked for drag, or 2 = being actively dragged.
dragStartXnumber The x coordinate of the Game Object that owns this Interactive Object when the drag started.
dragStartYnumber The y coordinate of the Game Object that owns this Interactive Object when the drag started.
dragStartXGlobalnumber The x coordinate that the Pointer started dragging this Interactive Object from.
dragStartYGlobalnumber The y coordinate that the Pointer started dragging this Interactive Object from.
dragXnumber The x coordinate that this Interactive Object is currently being dragged to.
dragYnumber The y coordinate that this Interactive Object is currently being dragged to.
