-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update package version with improvements and mouse button support
- Loading branch information
1 parent
db6b805
commit a35bd96
Showing
10 changed files
with
3,471 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "phaser-kinetic-scrolling-plugin", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"homepage": "https://github.com/jdnichollsc/Phaser-Kinetic-Scrolling-Plugin", | ||
"authors": [ | ||
"Juan David Nicholls Cardona <[email protected]>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* @author Juan Nicholls <[email protected]> | ||
* @copyright 2018 Juan Nicholls - http://jdnichollsc.github.io/Phaser-Kinetic-Scrolling-Plugin/ | ||
* @license {@link http://opensource.org/licenses/MIT} | ||
* @version 1.1.2 | ||
* @version 1.2.0 | ||
*/ | ||
|
||
(function (Phaser) { | ||
|
@@ -64,7 +64,8 @@ | |
horizontalWheel: true, | ||
verticalWheel: false, | ||
deltaWheel: 40, | ||
onUpdate: null | ||
onUpdate: null, | ||
button: "" | ||
}; | ||
}; | ||
|
||
|
@@ -83,6 +84,7 @@ | |
* @param {boolean} [options.horizontalWheel=true] - Enable or Disable the horizontal scrolling with mouse wheel. | ||
* @param {boolean} [options.verticalWheel=false] - Enable or Disable the vertical scrolling with mouse wheel. | ||
* @param {number} [options.deltaWheel=40] - Delta increment of the mouse wheel. | ||
* @param {string} [options.button=""] - Phaser button code to start drag (LEFT_BUTTON, RIGHT_BUTTON, etc). | ||
*/ | ||
Phaser.Plugin.KineticScrolling.prototype.configure = function (options) { | ||
|
||
|
@@ -116,7 +118,11 @@ | |
* Event triggered when a pointer is pressed down, resets the value of variables. | ||
*/ | ||
Phaser.Plugin.KineticScrolling.prototype.beginMove = function (pointer) { | ||
|
||
|
||
if (this.settings.button && pointer.button !== Phaser.Mouse[this.settings.button]) { | ||
return; | ||
} | ||
|
||
this.pointerId = pointer.id; | ||
this.startX = this.game.input.x; | ||
this.startY = this.game.input.y; | ||
|
@@ -475,4 +481,4 @@ | |
|
||
}; | ||
|
||
}(Phaser)); | ||
}(Phaser)); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* @author Juan Nicholls <[email protected]> | ||
* @copyright 2018 Juan Nicholls - http://jdnichollsc.github.io/Phaser-Kinetic-Scrolling-Plugin/ | ||
* @license {@link http://opensource.org/licenses/MIT} | ||
* @version 1.1.2 | ||
* @version 1.2.0 | ||
*/ | ||
|
||
(function (Phaser) { | ||
|
@@ -64,7 +64,8 @@ | |
horizontalWheel: true, | ||
verticalWheel: false, | ||
deltaWheel: 40, | ||
onUpdate: null | ||
onUpdate: null, | ||
button: "" | ||
}; | ||
}; | ||
|
||
|
@@ -83,6 +84,7 @@ | |
* @param {boolean} [options.horizontalWheel=true] - Enable or Disable the horizontal scrolling with mouse wheel. | ||
* @param {boolean} [options.verticalWheel=false] - Enable or Disable the vertical scrolling with mouse wheel. | ||
* @param {number} [options.deltaWheel=40] - Delta increment of the mouse wheel. | ||
* @param {string} [options.button=""] - Phaser button code to start drag (LEFT_BUTTON, RIGHT_BUTTON, etc). | ||
*/ | ||
Phaser.Plugin.KineticScrolling.prototype.configure = function (options) { | ||
|
||
|
@@ -116,7 +118,11 @@ | |
* Event triggered when a pointer is pressed down, resets the value of variables. | ||
*/ | ||
Phaser.Plugin.KineticScrolling.prototype.beginMove = function (pointer) { | ||
|
||
|
||
if (this.settings.button && pointer.button !== Phaser.Mouse[this.settings.button]) { | ||
return; | ||
} | ||
|
||
this.pointerId = pointer.id; | ||
this.startX = this.game.input.x; | ||
this.startY = this.game.input.y; | ||
|
@@ -475,4 +481,4 @@ | |
|
||
}; | ||
|
||
}(Phaser)); | ||
}(Phaser)); |
Oops, something went wrong.