mirror of
https://github.com/photonstorm/phaser
synced 2024-12-18 17:16:03 +00:00
1 line
No EOL
23 KiB
JSON
1 line
No EOL
23 KiB
JSON
{"class":{"name":"Phaser.Input","extends":"","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":"Current game instance.","optional":false,"default":null}],"help":"Phaser.Input is the Input Manager for all types of Input across Phaser, including mouse, keyboard, touch and MSPointer.\\nThe Input manager is updated automatically by the core game loop."},"consts":[{"name":"MOUSE_OVERRIDES_TOUCH","type":"number","help":"","line":318},{"name":"MOUSE_TOUCH_COMBINE","type":"number","help":"","line":330},{"name":"TOUCH_OVERRIDES_MOUSE","type":"number","help":"","line":324}],"methods":{"public":[{"name":"addMoveCallback","static":false,"returns":{"types":["number"],"help":"The index of the callback entry. Use this index when calling Input.deleteMoveCallback."},"help":"Adds a callback that is fired every time the activePointer receives a DOM move event such as a mousemove or touchmove.\\nIt will be called every time the activePointer moves, which in a multi-touch game can be a lot of times, so this is best\\nto only use if you've limited input to a single pointer (i.e. mouse or touch).\\nThe callback is added to the Phaser.Input.moveCallbacks array and should be removed with Phaser.Input.deleteMoveCallback.","line":406,"public":true,"protected":false,"private":false,"parameters":[{"name":"callback","type":["function"],"help":"The callback that will be called each time the activePointer receives a DOM move event.","optional":false,"default":null},{"name":"context","type":["object"],"help":"The context in which the callback will be called.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"addPointer","static":false,"returns":{"types":["Phaser.Pointer"],"help":"A reference to the new Pointer object that was created."},"help":"Add a new Pointer object to the Input Manager. By default Input creates 3 pointer objects: mousePointer, pointer1 and pointer2.\\nIf you need more then use this to create a new one, up to a maximum of 10.","line":433,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"deleteMoveCallback","static":false,"returns":null,"help":"Removes the callback at the defined index from the Phaser.Input.moveCallbacks array","line":418,"public":true,"protected":false,"private":false,"parameters":[{"name":"index","type":["number"],"help":"The index of the callback to remove.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"destroy","static":false,"returns":null,"help":"Stops all of the Input Managers from running.","line":383,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"getLocalPosition","static":false,"returns":{"types":["Phaser.Point"],"help":"A point containing the coordinates of the Pointer position relative to the DisplayObject."},"help":"This will return the local coordinates of the specified displayObject based on the given Pointer.","line":771,"public":true,"protected":false,"private":false,"parameters":[{"name":"displayObject","type":["Phaser.Sprite","Phaser.Image"],"help":"The DisplayObject to get the local coordinates for.","optional":false,"default":null},{"name":"pointer","type":["Phaser.Pointer"],"help":"The Pointer to use in the check against the displayObject.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getPointer","static":false,"returns":{"types":["Phaser.Pointer"],"help":"A Pointer object or null if no Pointer object matches the requested state."},"help":"Get the next Pointer object whos active property matches the given state","line":668,"public":true,"protected":false,"private":false,"parameters":[{"name":"state","type":["boolean"],"help":"The state the Pointer should be in (false for inactive, true for active).","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getPointerFromId","static":false,"returns":{"types":["Phaser.Pointer"],"help":"A Pointer object or null if no Pointer object matches the requested identifier."},"help":"Get the Pointer object whos `pointerId` property matches the given value.\\nThe pointerId property is not set until the Pointer has been used at least once, as its populated by the DOM event.\\nAlso it can change every time you press the pointer down if the browser recycles it.","line":739,"public":true,"protected":false,"private":false,"parameters":[{"name":"pointerId","type":["number"],"help":"The Pointer.pointerId value to search for.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"getPointerFromIdentifier","static":false,"returns":{"types":["Phaser.Pointer"],"help":"A Pointer object or null if no Pointer object matches the requested identifier."},"help":"Get the Pointer object whos `identifier` property matches the given identifier value.\\nThe identifier property is not set until the Pointer has been used at least once, as its populated by the DOM event.\\nAlso it can change every time you press the pointer down, and is not fixed once set.\\nNote: Not all browsers set the identifier property and it's not part of the W3C spec, so you may need getPointerFromId instead.","line":705,"public":true,"protected":false,"private":false,"parameters":[{"name":"identifier","type":["number"],"help":"The Pointer.identifier value to search for.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"hitTest","static":false,"returns":null,"help":"Tests if the pointer hits the given object.","line":793,"public":true,"protected":false,"private":false,"parameters":[{"name":"displayObject","type":["PIXI.DisplayObject"],"help":"The displayObject to test for a hit.","optional":false,"default":null},{"name":"pointer","type":["Phaser.Pointer"],"help":"The pointer to use for the test.","optional":false,"default":null},{"name":"localPoint","type":["Phaser.Point"],"help":"The local translated point.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"reset","static":false,"returns":null,"help":"Reset all of the Pointers and Input states. The optional `hard` parameter will reset any events or callbacks that may be bound.\\nInput.reset is called automatically during a State change or if a game loses focus \/ visibility. If you wish to control the reset\\ndirectly yourself then set InputManager.resetLocked to `true`.","line":506,"public":true,"protected":false,"private":false,"parameters":[{"name":"hard","type":["boolean"],"help":"A soft reset won't reset any events or callbacks that are bound. A hard reset will.","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"resetSpeed","static":false,"returns":null,"help":"Resets the speed and old position properties.","line":557,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"Sets the oldPosition.x value.","optional":false,"default":null},{"name":"y","type":["number"],"help":"Sets the oldPosition.y value.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"startPointer","static":false,"returns":{"types":["Phaser.Pointer"],"help":"The Pointer object that was started or null if no Pointer object is available."},"help":"Find the first free Pointer object and start it, passing in the event data. This is called automatically by Phaser.Touch and Phaser.MSPointer.","line":570,"public":true,"protected":false,"private":false,"parameters":[{"name":"event","type":["any"],"help":"The event data from the Touch event.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"stopPointer","static":false,"returns":{"types":["Phaser.Pointer"],"help":"The Pointer object that was stopped or null if no Pointer object is available."},"help":"Stops the matching Pointer object, passing in the event data.","line":637,"public":true,"protected":false,"private":false,"parameters":[{"name":"event","type":["any"],"help":"The event data from the Touch event.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"updatePointer","static":false,"returns":{"types":["Phaser.Pointer"],"help":"The Pointer object that was updated or null if no Pointer object is available."},"help":"Updates the matching Pointer object, passing in the event data. This is called automatically and should not normally need to be invoked.","line":606,"public":true,"protected":false,"private":false,"parameters":[{"name":"event","type":["any"],"help":"The event data from the Touch event.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""}],"protected":[{"name":"boot","static":false,"returns":null,"help":"Starts the Input Manager running.","line":339,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"update","static":false,"returns":null,"help":"Updates the Input Manager. Called by the core Game loop.","line":464,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""}],"private":[],"static":[]},"properties":{"public":[{"name":"activePointer","type":["Phaser.Pointer"],"help":"The most recently active Pointer object.\\nWhen you've limited max pointers to 1 this will accurately be either the first finger touched or mouse.","inlineHelp":"","line":212,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"circle","type":["Phaser.Circle"],"help":"A Circle object centered on the x\/y screen coordinates of the Input.\\nDefault size of 44px (Apples recommended \"finger tip\" size) but can be changed to anything.","inlineHelp":"","line":85,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"currentPointers","type":["number"],"help":"","inlineHelp":"The current number of active Pointers.","line":102,"default":"0","public":true,"protected":false,"private":false,"readOnly":false},{"name":"disabled","type":["boolean"],"help":"You can disable all Input by setting Input.disabled = true. While set all new input related events will be ignored.\\nIf you need to disable just one type of input; for example mouse; use Input.mouse.disabled = true instead","inlineHelp":"","line":61,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"doubleTapRate","type":["number"],"help":"","inlineHelp":"The number of milliseconds between taps of the same Pointer for it to be considered a double tap \/ click.","line":114,"default":"300","public":true,"protected":false,"private":false,"readOnly":false},{"name":"game","type":["Phaser.Game"],"help":"","inlineHelp":"A reference to the currently running game.","line":20,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"gamepad","type":["Phaser.Gamepad"],"help":"","inlineHelp":"The Gamepad Input manager.","line":242,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"hitCanvas","type":["HTMLCanvasElement"],"help":"","inlineHelp":"The canvas to which single pixels are drawn in order to perform pixel-perfect hit detection.","line":26,"default":"null","public":true,"protected":false,"private":false,"readOnly":false},{"name":"hitContext","type":["CanvasRenderingContext2D"],"help":"","inlineHelp":"The context of the pixel perfect hit canvas.","line":32,"default":"null","public":true,"protected":false,"private":false,"readOnly":false},{"name":"holdRate","type":["number"],"help":"","inlineHelp":"The number of milliseconds that the Pointer has to be pressed down for it to fire a onHold event.","line":120,"default":"2000","public":true,"protected":false,"private":false,"readOnly":false},{"name":"interactiveItems","type":["Phaser.ArrayList"],"help":"A list of interactive objects. The InputHandler components add and remove themselves from this list.","inlineHelp":"","line":280,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"justPressedRate","type":["number"],"help":"","inlineHelp":"The number of milliseconds below which the Pointer is considered justPressed.","line":126,"default":"200","public":true,"protected":false,"private":false,"readOnly":false},{"name":"justReleasedRate","type":["number"],"help":"","inlineHelp":"The number of milliseconds below which the Pointer is considered justReleased .","line":132,"default":"200","public":true,"protected":false,"private":false,"readOnly":false},{"name":"keyboard","type":["Phaser.Keyboard"],"help":"","inlineHelp":"The Keyboard Input manager.","line":227,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"maxPointers","type":["number"],"help":"","inlineHelp":"The maximum number of Pointers allowed to be active at any one time. For lots of games it's useful to set this to 1.","line":96,"default":"10","public":true,"protected":false,"private":false,"readOnly":false},{"name":"minPriorityID","type":["number"],"help":"","inlineHelp":"You can tell all Pointers to ignore any object with a priorityID lower than the minPriorityID. Useful when stacking UI layers. Set to zero to disable.","line":274,"default":"0","public":true,"protected":false,"private":false,"readOnly":false},{"name":"mouse","type":["Phaser.Mouse"],"help":"","inlineHelp":"The Mouse Input manager.","line":222,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"mousePointer","type":["Pointer"],"help":"","inlineHelp":"The mouse has its own unique Phaser.Pointer object which you can use if making a desktop specific game.","line":217,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"moveCallback","type":["function"],"help":"","inlineHelp":"An optional callback that will be fired every time the activePointer receives a move event from the DOM. Set to null to disable.","line":42,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"moveCallbackContext","type":["object"],"help":"","inlineHelp":"The context in which the moveCallback will be sent. Defaults to Phaser.Input but can be set to any valid JS object.","line":47,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"moveCallbacks","type":["array"],"help":"","inlineHelp":"An array of callbacks that will be fired every time the activePointer receives a move event from the DOM.","line":37,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"mspointer","type":["Phaser.MSPointer"],"help":"","inlineHelp":"The MSPointer Input manager.","line":237,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"multiInputOverride","type":["number"],"help":"","inlineHelp":"Controls the expected behaviour when using a mouse and touch together on a multi-input device.","line":67,"default":"Phaser.Input.MOUSE_TOUCH_COMBINE","public":true,"protected":false,"private":false,"readOnly":false},{"name":"onDown","type":["Phaser.Signal"],"help":"","inlineHelp":"A Signal that is dispatched each time a pointer is pressed down.","line":253,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onHold","type":["Phaser.Signal"],"help":"","inlineHelp":"A Signal that is dispatched each time a pointer is held down.","line":268,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onTap","type":["Phaser.Signal"],"help":"","inlineHelp":"A Signal that is dispatched each time a pointer is tapped.","line":263,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"onUp","type":["Phaser.Signal"],"help":"","inlineHelp":"A Signal that is dispatched each time a pointer is released.","line":258,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"pointer1","type":["Phaser.Pointer"],"help":"","inlineHelp":"A Pointer object.","line":160,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"pointer10","type":["Phaser.Pointer"],"help":"","inlineHelp":"A Pointer object.","line":205,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"pointer2","type":["Phaser.Pointer"],"help":"","inlineHelp":"A Pointer object.","line":165,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"pointer3","type":["Phaser.Pointer"],"help":"","inlineHelp":"A Pointer object.","line":170,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"pointer4","type":["Phaser.Pointer"],"help":"","inlineHelp":"A Pointer object.","line":175,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"pointer5","type":["Phaser.Pointer"],"help":"","inlineHelp":"A Pointer object.","line":180,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"pointer6","type":["Phaser.Pointer"],"help":"","inlineHelp":"A Pointer object.","line":185,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"pointer7","type":["Phaser.Pointer"],"help":"","inlineHelp":"A Pointer object.","line":190,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"pointer8","type":["Phaser.Pointer"],"help":"","inlineHelp":"A Pointer object.","line":195,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"pointer9","type":["Phaser.Pointer"],"help":"","inlineHelp":"A Pointer object.","line":200,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"pollLocked","type":["boolean"],"help":"","inlineHelp":"True if the Input is currently poll rate locked.","line":915,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"pollRate","type":["number"],"help":"","inlineHelp":"How often should the input pointers be checked for updates? A value of 0 means every single frame (60fps); a value of 1 means every other frame (30fps) and so on.","line":53,"default":"0","public":true,"protected":false,"private":false,"readOnly":false},{"name":"position","type":["Phaser.Point"],"help":"","inlineHelp":"A point object representing the current position of the Pointer.","line":73,"default":"null","public":true,"protected":false,"private":false,"readOnly":false},{"name":"recordLimit","type":["number"],"help":"The total number of entries that can be recorded into the Pointer objects tracking history.\\nIf the Pointer is tracking one event every 100ms; then a trackLimit of 100 would store the last 10 seconds worth of history.","inlineHelp":"","line":155,"default":"100","public":true,"protected":false,"private":false,"readOnly":false},{"name":"recordPointerHistory","type":["boolean"],"help":"Sets if the Pointer objects should record a history of x\/y coordinates they have passed through.\\nThe history is cleared each time the Pointer is pressed down.\\nThe history is updated at the rate specified in Input.pollRate","inlineHelp":"","line":141,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"recordRate","type":["number"],"help":"","inlineHelp":"The rate in milliseconds at which the Pointer objects should update their tracking history.","line":147,"default":"100","public":true,"protected":false,"private":false,"readOnly":false},{"name":"resetLocked","type":["boolean"],"help":"","inlineHelp":"If the Input Manager has been reset locked then all calls made to InputManager.reset, such as from a State change, are ignored.","line":248,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"scale","type":["Phaser.Point"],"help":"","inlineHelp":"The scale by which all input coordinates are multiplied; calculated by the ScaleManager. In an un-scaled game the values will be x = 1 and y = 1.","line":90,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"speed","type":["Phaser.Point"],"help":"","inlineHelp":"A point object representing the speed of the Pointer. Only really useful in single Pointer games; otherwise see the Pointer objects directly.","line":78,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"tapRate","type":["number"],"help":"","inlineHelp":"The number of milliseconds that the Pointer has to be pressed down and then released to be considered a tap or click.","line":108,"default":"200","public":true,"protected":false,"private":false,"readOnly":false},{"name":"totalActivePointers","type":["number"],"help":"The total number of active Pointers","inlineHelp":"The total number of active Pointers.","line":943,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"totalInactivePointers","type":["number"],"help":"The total number of inactive Pointers","inlineHelp":"The total number of inactive Pointers.","line":929,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"touch","type":["Phaser.Touch"],"help":"","inlineHelp":"the Touch Input manager.","line":232,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"worldX","type":["number"],"help":"The world X coordinate of the most recently active pointer.","inlineHelp":"The world X coordinate of the most recently active pointer.","line":968,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"worldY","type":["number"],"help":"The world Y coordinate of the most recently active pointer.","inlineHelp":"The world Y coordinate of the most recently active pointer.","line":981,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"x","type":["number"],"help":"The X coordinate of the most recently active pointer. This value takes game scaling into account automatically. See Pointer.screenX\/clientX for source values.","inlineHelp":"The X coordinate of the most recently active pointer.","line":881,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"y","type":["number"],"help":"The Y coordinate of the most recently active pointer. This value takes game scaling into account automatically. See Pointer.screenY\/clientY for source values.","inlineHelp":"The Y coordinate of the most recently active pointer.","line":898,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[{"name":"_localPoint","type":["Phaser.Point"],"help":"","inlineHelp":"Internal cache var.","line":286,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_oldPosition","type":["Phaser.Point"],"help":"","inlineHelp":"A point object representing the previous position of the Pointer.","line":298,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_pollCounter","type":["number"],"help":"","inlineHelp":"Internal var holding the current poll counter.","line":292,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_x","type":["number"],"help":"","inlineHelp":"x coordinate of the most recent Pointer event","line":304,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_y","type":["number"],"help":"","inlineHelp":"Y coordinate of the most recent Pointer event","line":310,"default":null,"public":false,"protected":false,"private":true,"readOnly":false}]}} |