66
77/**
88* The Input Handler is bound to a specific Sprite and is responsible for managing all Input events on that Sprite.
9- *
9+ *
1010* @class Phaser.InputHandler
1111* @constructor
1212* @param {Phaser.Sprite } sprite - The Sprite object to which this Input Handler belongs.
@@ -455,7 +455,7 @@ Phaser.InputHandler.prototype = {
455455 /**
456456 * The x coordinate of the Input pointer, relative to the top-left of the parent Sprite.
457457 * This value is only set when the pointer is over this Sprite.
458- *
458+ *
459459 * @method Phaser.InputHandler#pointerX
460460 * @param {number } pointer - The index of the pointer to check. You can get this from Phaser.Pointer.id.
461461 * @return {number } The x coordinate of the Input pointer.
@@ -471,7 +471,7 @@ Phaser.InputHandler.prototype = {
471471 /**
472472 * The y coordinate of the Input pointer, relative to the top-left of the parent Sprite
473473 * This value is only set when the pointer is over this Sprite.
474- *
474+ *
475475 * @method Phaser.InputHandler#pointerY
476476 * @param {number } pointer - The index of the pointer to check. You can get this from Phaser.Pointer.id.
477477 * @return {number } The y coordinate of the Input pointer.
@@ -486,7 +486,7 @@ Phaser.InputHandler.prototype = {
486486
487487 /**
488488 * If the Pointer is down this returns true. Please note that it only checks if the Pointer is down, not if it's down over any specific Sprite.
489- *
489+ *
490490 * @method Phaser.InputHandler#pointerDown
491491 * @param {number } pointer - The index of the pointer to check. You can get this from Phaser.Pointer.id.
492492 * @return {boolean } - True if the given pointer is down, otherwise false.
@@ -501,7 +501,7 @@ Phaser.InputHandler.prototype = {
501501
502502 /**
503503 * If the Pointer is up this returns true. Please note that it only checks if the Pointer is up, not if it's up over any specific Sprite.
504- *
504+ *
505505 * @method Phaser.InputHandler#pointerUp
506506 * @param {number } pointer - The index of the pointer to check. You can get this from Phaser.Pointer.id.
507507 * @return {boolean } - True if the given pointer is up, otherwise false.
@@ -516,7 +516,7 @@ Phaser.InputHandler.prototype = {
516516
517517 /**
518518 * A timestamp representing when the Pointer first touched the touchscreen.
519- *
519+ *
520520 * @method Phaser.InputHandler#pointerTimeDown
521521 * @param {number } pointer - The index of the pointer to check. You can get this from Phaser.Pointer.id.
522522 * @return {number }
@@ -545,7 +545,7 @@ Phaser.InputHandler.prototype = {
545545
546546 /**
547547 * Is the Pointer over this Sprite?
548- *
548+ *
549549 * @method Phaser.InputHandler#pointerOver
550550 * @param {number } [index] - The ID number of a Pointer to check. If you don't provide a number it will check all Pointers.
551551 * @return {boolean } - True if the given pointer (if a index was given, or any pointer if not) is over this object.
@@ -649,7 +649,7 @@ Phaser.InputHandler.prototype = {
649649 /**
650650 * Checks if the given pointer is both down and over the Sprite this InputHandler belongs to.
651651 * Use the `fastTest` flag is to quickly check just the bounding hit area even if `InputHandler.pixelPerfectOver` is `true`.
652- *
652+ *
653653 * @method Phaser.InputHandler#checkPointerDown
654654 * @param {Phaser.Pointer } pointer
655655 * @param {boolean } [fastTest=false] - Force a simple hit area check even if `pixelPerfectOver` is true for this object?
@@ -684,7 +684,7 @@ Phaser.InputHandler.prototype = {
684684 /**
685685 * Checks if the given pointer is over the Sprite this InputHandler belongs to.
686686 * Use the `fastTest` flag is to quickly check just the bounding hit area even if `InputHandler.pixelPerfectOver` is `true`.
687- *
687+ *
688688 * @method Phaser.InputHandler#checkPointerOver
689689 * @param {Phaser.Pointer } pointer
690690 * @param {boolean } [fastTest=false] - Force a simple hit area check even if `pixelPerfectOver` is true for this object?
@@ -915,7 +915,7 @@ Phaser.InputHandler.prototype = {
915915 this . _pointerData [ pointer . id ] . isDown = true ;
916916 this . _pointerData [ pointer . id ] . isUp = false ;
917917 this . _pointerData [ pointer . id ] . timeDown = this . game . time . now ;
918-
918+
919919 if ( this . sprite && this . sprite . events )
920920 {
921921 this . sprite . events . onInputDown . dispatch ( this . sprite , pointer ) ;
@@ -1192,12 +1192,12 @@ Phaser.InputHandler.prototype = {
11921192 */
11931193 enableDrag : function ( lockCenter , bringToTop , pixelPerfect , alphaThreshold , boundsRect , boundsSprite ) {
11941194
1195- if ( typeof lockCenter == 'undefined' ) { lockCenter = false ; }
1196- if ( typeof bringToTop == 'undefined' ) { bringToTop = false ; }
1197- if ( typeof pixelPerfect == 'undefined' ) { pixelPerfect = false ; }
1198- if ( typeof alphaThreshold == 'undefined' ) { alphaThreshold = 255 ; }
1199- if ( typeof boundsRect == 'undefined' ) { boundsRect = null ; }
1200- if ( typeof boundsSprite == 'undefined' ) { boundsSprite = null ; }
1195+ if ( typeof lockCenter === 'undefined' ) { lockCenter = false ; }
1196+ if ( typeof bringToTop === 'undefined' ) { bringToTop = false ; }
1197+ if ( typeof pixelPerfect === 'undefined' ) { pixelPerfect = false ; }
1198+ if ( typeof alphaThreshold === 'undefined' ) { alphaThreshold = 255 ; }
1199+ if ( typeof boundsRect === 'undefined' ) { boundsRect = null ; }
1200+ if ( typeof boundsSprite === 'undefined' ) { boundsSprite = null ; }
12011201
12021202 this . _dragPoint = new Phaser . Point ( ) ;
12031203 this . draggable = true ;
@@ -1272,7 +1272,7 @@ Phaser.InputHandler.prototype = {
12721272 this . sprite . x = this . globalToLocalX ( pointer . x ) + ( this . sprite . x - bounds . centerX ) ;
12731273 this . sprite . y = this . globalToLocalY ( pointer . y ) + ( this . sprite . y - bounds . centerY ) ;
12741274 }
1275-
1275+
12761276 this . _dragPoint . setTo ( this . sprite . x - this . globalToLocalX ( pointer . x ) , this . sprite . y - this . globalToLocalY ( pointer . y ) ) ;
12771277 }
12781278
@@ -1365,8 +1365,8 @@ Phaser.InputHandler.prototype = {
13651365 */
13661366 setDragLock : function ( allowHorizontal , allowVertical ) {
13671367
1368- if ( typeof allowHorizontal == 'undefined' ) { allowHorizontal = true ; }
1369- if ( typeof allowVertical == 'undefined' ) { allowVertical = true ; }
1368+ if ( typeof allowHorizontal === 'undefined' ) { allowHorizontal = true ; }
1369+ if ( typeof allowVertical === 'undefined' ) { allowVertical = true ; }
13701370
13711371 this . allowHorizontalDrag = allowHorizontal ;
13721372 this . allowVerticalDrag = allowVertical ;
@@ -1386,10 +1386,10 @@ Phaser.InputHandler.prototype = {
13861386 */
13871387 enableSnap : function ( snapX , snapY , onDrag , onRelease , snapOffsetX , snapOffsetY ) {
13881388
1389- if ( typeof onDrag == 'undefined' ) { onDrag = true ; }
1390- if ( typeof onRelease == 'undefined' ) { onRelease = false ; }
1391- if ( typeof snapOffsetX == 'undefined' ) { snapOffsetX = 0 ; }
1392- if ( typeof snapOffsetY == 'undefined' ) { snapOffsetY = 0 ; }
1389+ if ( typeof onDrag === 'undefined' ) { onDrag = true ; }
1390+ if ( typeof onRelease === 'undefined' ) { onRelease = false ; }
1391+ if ( typeof snapOffsetX === 'undefined' ) { snapOffsetX = 0 ; }
1392+ if ( typeof snapOffsetY === 'undefined' ) { snapOffsetY = 0 ; }
13931393
13941394 this . snapX = snapX ;
13951395 this . snapY = snapY ;
0 commit comments