mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 05:03:37 +00:00
parent
cad0338449
commit
962066102c
14 changed files with 545 additions and 305 deletions
|
@ -249,6 +249,7 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
|
|||
### Updates
|
||||
|
||||
* TypeScript definitions fixes and updates (thanks @clark-stevenson @shivinsky)
|
||||
* JSDoc typo fixes (thanks @DrkSephy)
|
||||
* TilemapLayer - Fixed unmatched `context.save` and `context.restore` calls (thanks @MortimerGoro #1934)
|
||||
* Cache.getFrame has a new `cache` parameter (that defaults to the Image cache, but can be changed to any other)
|
||||
* Cache.getFrameCount has a new `cache` parameter (that defaults to the Image cache, but can be changed to any other)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Phaser - http://phaser.io
|
||||
*
|
||||
* v2.4.2 "Altara" - Built: Mon Jul 27 2015 13:35:18
|
||||
* v2.4.2 "Altara" - Built: Tue Jul 28 2015 14:17:06
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -28225,6 +28225,94 @@ Phaser.Pointer.prototype = {
|
|||
|
||||
},
|
||||
|
||||
/**
|
||||
* Called by updateButtons.
|
||||
*
|
||||
* @method Phaser.Pointer#processButtonsDown
|
||||
* @private
|
||||
* @param {integer} buttons - The DOM event.buttons property.
|
||||
* @param {MouseEvent} event - The DOM event.
|
||||
*/
|
||||
processButtonsDown: function (buttons, event) {
|
||||
|
||||
// Note: These are bitwise checks, not booleans
|
||||
|
||||
if (Phaser.Pointer.LEFT_BUTTON & buttons)
|
||||
{
|
||||
this.leftButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.RIGHT_BUTTON & buttons)
|
||||
{
|
||||
this.rightButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.MIDDLE_BUTTON & buttons)
|
||||
{
|
||||
this.middleButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.BACK_BUTTON & buttons)
|
||||
{
|
||||
this.backButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.FORWARD_BUTTON & buttons)
|
||||
{
|
||||
this.forwardButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.ERASER_BUTTON & buttons)
|
||||
{
|
||||
this.eraserButton.start(event);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Called by updateButtons.
|
||||
*
|
||||
* @method Phaser.Pointer#processButtonsUp
|
||||
* @private
|
||||
* @param {integer} buttons - The DOM event.buttons property.
|
||||
* @param {MouseEvent} event - The DOM event.
|
||||
*/
|
||||
processButtonsUp: function (button, event) {
|
||||
|
||||
// Note: These are bitwise checks, not booleans
|
||||
|
||||
if (button === Phaser.Mouse.LEFT_BUTTON)
|
||||
{
|
||||
this.leftButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.RIGHT_BUTTON)
|
||||
{
|
||||
this.rightButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.MIDDLE_BUTTON)
|
||||
{
|
||||
this.middleButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.BACK_BUTTON)
|
||||
{
|
||||
this.backButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.FORWARD_BUTTON)
|
||||
{
|
||||
this.forwardButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === 5)
|
||||
{
|
||||
this.eraserButton.stop(event);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Called when the event.buttons property changes from zero.
|
||||
* Contains a button bitmask.
|
||||
|
@ -28237,73 +28325,23 @@ Phaser.Pointer.prototype = {
|
|||
|
||||
this.button = event.button;
|
||||
|
||||
// This is tested back to IE9, but possibly some browsers may report this differently.
|
||||
// If you find one, please tell us!
|
||||
var buttons = event.buttons;
|
||||
var down = (event.type.toLowerCase().substr(-4) === 'down');
|
||||
|
||||
if (buttons !== undefined)
|
||||
if (event.buttons !== undefined)
|
||||
{
|
||||
// Note: These are bitwise checks, not booleans
|
||||
|
||||
if (Phaser.Pointer.LEFT_BUTTON & buttons)
|
||||
if (down)
|
||||
{
|
||||
this.leftButton.start(event);
|
||||
this.processButtonsDown(event.buttons, event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.leftButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.RIGHT_BUTTON & buttons)
|
||||
{
|
||||
this.rightButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.rightButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.MIDDLE_BUTTON & buttons)
|
||||
{
|
||||
this.middleButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.middleButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.BACK_BUTTON & buttons)
|
||||
{
|
||||
this.backButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.backButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.FORWARD_BUTTON & buttons)
|
||||
{
|
||||
this.forwardButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.forwardButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.ERASER_BUTTON & buttons)
|
||||
{
|
||||
this.eraserButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.eraserButton.stop(event);
|
||||
this.processButtonsUp(event.button, event);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// No buttons property (like Safari on OSX when using a trackpad)
|
||||
|
||||
if (event.type === 'mousedown')
|
||||
if (down)
|
||||
{
|
||||
this.leftButton.start(event);
|
||||
}
|
||||
|
@ -28316,6 +28354,7 @@ Phaser.Pointer.prototype = {
|
|||
|
||||
// On OS X (and other devices with trackpads) you have to press CTRL + the pad
|
||||
// to initiate a right-click event, so we'll check for that here
|
||||
|
||||
if (event.ctrlKey && this.leftButton.isDown)
|
||||
{
|
||||
this.rightButton.start(event);
|
||||
|
@ -28339,6 +28378,8 @@ Phaser.Pointer.prototype = {
|
|||
*/
|
||||
start: function (event) {
|
||||
|
||||
// console.log(event);
|
||||
|
||||
if (event['pointerId'])
|
||||
{
|
||||
this.pointerId = event.pointerId;
|
||||
|
@ -57219,6 +57260,10 @@ Phaser.Cache.prototype = {
|
|||
/**
|
||||
* Removes a sound from the cache.
|
||||
*
|
||||
* If any `Phaser.Sound` objects use the audio file in the cache that you remove with this method, they will
|
||||
* _automatically_ destroy themselves. If you wish to have full control over when Sounds are destroyed then
|
||||
* you must finish your house-keeping and destroy them all yourself first, before calling this method.
|
||||
*
|
||||
* Note that this only removes it from the Phaser.Cache. If you still have references to the data elsewhere
|
||||
* then it will persist in memory.
|
||||
*
|
||||
|
@ -61158,6 +61203,12 @@ Phaser.Sound.prototype = {
|
|||
*/
|
||||
update: function () {
|
||||
|
||||
if (!this.game.cache.checkSoundKey(this.key))
|
||||
{
|
||||
this.destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isDecoded && !this._onDecodedEventDispatched)
|
||||
{
|
||||
this.onDecoded.dispatch(this);
|
||||
|
|
File diff suppressed because one or more lines are too long
10
build/custom/phaser-arcade-physics.min.js
vendored
10
build/custom/phaser-arcade-physics.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Phaser - http://phaser.io
|
||||
*
|
||||
* v2.4.2 "Altara" - Built: Mon Jul 27 2015 13:35:35
|
||||
* v2.4.2 "Altara" - Built: Tue Jul 28 2015 14:17:23
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -27031,6 +27031,94 @@ Phaser.Pointer.prototype = {
|
|||
|
||||
},
|
||||
|
||||
/**
|
||||
* Called by updateButtons.
|
||||
*
|
||||
* @method Phaser.Pointer#processButtonsDown
|
||||
* @private
|
||||
* @param {integer} buttons - The DOM event.buttons property.
|
||||
* @param {MouseEvent} event - The DOM event.
|
||||
*/
|
||||
processButtonsDown: function (buttons, event) {
|
||||
|
||||
// Note: These are bitwise checks, not booleans
|
||||
|
||||
if (Phaser.Pointer.LEFT_BUTTON & buttons)
|
||||
{
|
||||
this.leftButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.RIGHT_BUTTON & buttons)
|
||||
{
|
||||
this.rightButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.MIDDLE_BUTTON & buttons)
|
||||
{
|
||||
this.middleButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.BACK_BUTTON & buttons)
|
||||
{
|
||||
this.backButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.FORWARD_BUTTON & buttons)
|
||||
{
|
||||
this.forwardButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.ERASER_BUTTON & buttons)
|
||||
{
|
||||
this.eraserButton.start(event);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Called by updateButtons.
|
||||
*
|
||||
* @method Phaser.Pointer#processButtonsUp
|
||||
* @private
|
||||
* @param {integer} buttons - The DOM event.buttons property.
|
||||
* @param {MouseEvent} event - The DOM event.
|
||||
*/
|
||||
processButtonsUp: function (button, event) {
|
||||
|
||||
// Note: These are bitwise checks, not booleans
|
||||
|
||||
if (button === Phaser.Mouse.LEFT_BUTTON)
|
||||
{
|
||||
this.leftButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.RIGHT_BUTTON)
|
||||
{
|
||||
this.rightButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.MIDDLE_BUTTON)
|
||||
{
|
||||
this.middleButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.BACK_BUTTON)
|
||||
{
|
||||
this.backButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.FORWARD_BUTTON)
|
||||
{
|
||||
this.forwardButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === 5)
|
||||
{
|
||||
this.eraserButton.stop(event);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Called when the event.buttons property changes from zero.
|
||||
* Contains a button bitmask.
|
||||
|
@ -27043,73 +27131,23 @@ Phaser.Pointer.prototype = {
|
|||
|
||||
this.button = event.button;
|
||||
|
||||
// This is tested back to IE9, but possibly some browsers may report this differently.
|
||||
// If you find one, please tell us!
|
||||
var buttons = event.buttons;
|
||||
var down = (event.type.toLowerCase().substr(-4) === 'down');
|
||||
|
||||
if (buttons !== undefined)
|
||||
if (event.buttons !== undefined)
|
||||
{
|
||||
// Note: These are bitwise checks, not booleans
|
||||
|
||||
if (Phaser.Pointer.LEFT_BUTTON & buttons)
|
||||
if (down)
|
||||
{
|
||||
this.leftButton.start(event);
|
||||
this.processButtonsDown(event.buttons, event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.leftButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.RIGHT_BUTTON & buttons)
|
||||
{
|
||||
this.rightButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.rightButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.MIDDLE_BUTTON & buttons)
|
||||
{
|
||||
this.middleButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.middleButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.BACK_BUTTON & buttons)
|
||||
{
|
||||
this.backButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.backButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.FORWARD_BUTTON & buttons)
|
||||
{
|
||||
this.forwardButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.forwardButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.ERASER_BUTTON & buttons)
|
||||
{
|
||||
this.eraserButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.eraserButton.stop(event);
|
||||
this.processButtonsUp(event.button, event);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// No buttons property (like Safari on OSX when using a trackpad)
|
||||
|
||||
if (event.type === 'mousedown')
|
||||
if (down)
|
||||
{
|
||||
this.leftButton.start(event);
|
||||
}
|
||||
|
@ -27122,6 +27160,7 @@ Phaser.Pointer.prototype = {
|
|||
|
||||
// On OS X (and other devices with trackpads) you have to press CTRL + the pad
|
||||
// to initiate a right-click event, so we'll check for that here
|
||||
|
||||
if (event.ctrlKey && this.leftButton.isDown)
|
||||
{
|
||||
this.rightButton.start(event);
|
||||
|
@ -27145,6 +27184,8 @@ Phaser.Pointer.prototype = {
|
|||
*/
|
||||
start: function (event) {
|
||||
|
||||
// console.log(event);
|
||||
|
||||
if (event['pointerId'])
|
||||
{
|
||||
this.pointerId = event.pointerId;
|
||||
|
@ -43959,6 +44000,10 @@ Phaser.Cache.prototype = {
|
|||
/**
|
||||
* Removes a sound from the cache.
|
||||
*
|
||||
* If any `Phaser.Sound` objects use the audio file in the cache that you remove with this method, they will
|
||||
* _automatically_ destroy themselves. If you wish to have full control over when Sounds are destroyed then
|
||||
* you must finish your house-keeping and destroy them all yourself first, before calling this method.
|
||||
*
|
||||
* Note that this only removes it from the Phaser.Cache. If you still have references to the data elsewhere
|
||||
* then it will persist in memory.
|
||||
*
|
||||
|
|
File diff suppressed because one or more lines are too long
12
build/custom/phaser-minimum.min.js
vendored
12
build/custom/phaser-minimum.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Phaser - http://phaser.io
|
||||
*
|
||||
* v2.4.2 "Altara" - Built: Mon Jul 27 2015 13:35:27
|
||||
* v2.4.2 "Altara" - Built: Tue Jul 28 2015 14:17:15
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -28225,6 +28225,94 @@ Phaser.Pointer.prototype = {
|
|||
|
||||
},
|
||||
|
||||
/**
|
||||
* Called by updateButtons.
|
||||
*
|
||||
* @method Phaser.Pointer#processButtonsDown
|
||||
* @private
|
||||
* @param {integer} buttons - The DOM event.buttons property.
|
||||
* @param {MouseEvent} event - The DOM event.
|
||||
*/
|
||||
processButtonsDown: function (buttons, event) {
|
||||
|
||||
// Note: These are bitwise checks, not booleans
|
||||
|
||||
if (Phaser.Pointer.LEFT_BUTTON & buttons)
|
||||
{
|
||||
this.leftButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.RIGHT_BUTTON & buttons)
|
||||
{
|
||||
this.rightButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.MIDDLE_BUTTON & buttons)
|
||||
{
|
||||
this.middleButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.BACK_BUTTON & buttons)
|
||||
{
|
||||
this.backButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.FORWARD_BUTTON & buttons)
|
||||
{
|
||||
this.forwardButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.ERASER_BUTTON & buttons)
|
||||
{
|
||||
this.eraserButton.start(event);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Called by updateButtons.
|
||||
*
|
||||
* @method Phaser.Pointer#processButtonsUp
|
||||
* @private
|
||||
* @param {integer} buttons - The DOM event.buttons property.
|
||||
* @param {MouseEvent} event - The DOM event.
|
||||
*/
|
||||
processButtonsUp: function (button, event) {
|
||||
|
||||
// Note: These are bitwise checks, not booleans
|
||||
|
||||
if (button === Phaser.Mouse.LEFT_BUTTON)
|
||||
{
|
||||
this.leftButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.RIGHT_BUTTON)
|
||||
{
|
||||
this.rightButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.MIDDLE_BUTTON)
|
||||
{
|
||||
this.middleButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.BACK_BUTTON)
|
||||
{
|
||||
this.backButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.FORWARD_BUTTON)
|
||||
{
|
||||
this.forwardButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === 5)
|
||||
{
|
||||
this.eraserButton.stop(event);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Called when the event.buttons property changes from zero.
|
||||
* Contains a button bitmask.
|
||||
|
@ -28237,73 +28325,23 @@ Phaser.Pointer.prototype = {
|
|||
|
||||
this.button = event.button;
|
||||
|
||||
// This is tested back to IE9, but possibly some browsers may report this differently.
|
||||
// If you find one, please tell us!
|
||||
var buttons = event.buttons;
|
||||
var down = (event.type.toLowerCase().substr(-4) === 'down');
|
||||
|
||||
if (buttons !== undefined)
|
||||
if (event.buttons !== undefined)
|
||||
{
|
||||
// Note: These are bitwise checks, not booleans
|
||||
|
||||
if (Phaser.Pointer.LEFT_BUTTON & buttons)
|
||||
if (down)
|
||||
{
|
||||
this.leftButton.start(event);
|
||||
this.processButtonsDown(event.buttons, event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.leftButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.RIGHT_BUTTON & buttons)
|
||||
{
|
||||
this.rightButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.rightButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.MIDDLE_BUTTON & buttons)
|
||||
{
|
||||
this.middleButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.middleButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.BACK_BUTTON & buttons)
|
||||
{
|
||||
this.backButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.backButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.FORWARD_BUTTON & buttons)
|
||||
{
|
||||
this.forwardButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.forwardButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.ERASER_BUTTON & buttons)
|
||||
{
|
||||
this.eraserButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.eraserButton.stop(event);
|
||||
this.processButtonsUp(event.button, event);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// No buttons property (like Safari on OSX when using a trackpad)
|
||||
|
||||
if (event.type === 'mousedown')
|
||||
if (down)
|
||||
{
|
||||
this.leftButton.start(event);
|
||||
}
|
||||
|
@ -28316,6 +28354,7 @@ Phaser.Pointer.prototype = {
|
|||
|
||||
// On OS X (and other devices with trackpads) you have to press CTRL + the pad
|
||||
// to initiate a right-click event, so we'll check for that here
|
||||
|
||||
if (event.ctrlKey && this.leftButton.isDown)
|
||||
{
|
||||
this.rightButton.start(event);
|
||||
|
@ -28339,6 +28378,8 @@ Phaser.Pointer.prototype = {
|
|||
*/
|
||||
start: function (event) {
|
||||
|
||||
// console.log(event);
|
||||
|
||||
if (event['pointerId'])
|
||||
{
|
||||
this.pointerId = event.pointerId;
|
||||
|
@ -57219,6 +57260,10 @@ Phaser.Cache.prototype = {
|
|||
/**
|
||||
* Removes a sound from the cache.
|
||||
*
|
||||
* If any `Phaser.Sound` objects use the audio file in the cache that you remove with this method, they will
|
||||
* _automatically_ destroy themselves. If you wish to have full control over when Sounds are destroyed then
|
||||
* you must finish your house-keeping and destroy them all yourself first, before calling this method.
|
||||
*
|
||||
* Note that this only removes it from the Phaser.Cache. If you still have references to the data elsewhere
|
||||
* then it will persist in memory.
|
||||
*
|
||||
|
@ -61158,6 +61203,12 @@ Phaser.Sound.prototype = {
|
|||
*/
|
||||
update: function () {
|
||||
|
||||
if (!this.game.cache.checkSoundKey(this.key))
|
||||
{
|
||||
this.destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isDecoded && !this._onDecodedEventDispatched)
|
||||
{
|
||||
this.onDecoded.dispatch(this);
|
||||
|
|
File diff suppressed because one or more lines are too long
6
build/custom/phaser-no-physics.min.js
vendored
6
build/custom/phaser-no-physics.min.js
vendored
File diff suppressed because one or more lines are too long
165
build/phaser.js
165
build/phaser.js
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Phaser - http://phaser.io
|
||||
*
|
||||
* v2.4.2 "Altara" - Built: Mon Jul 27 2015 13:35:06
|
||||
* v2.4.2 "Altara" - Built: Tue Jul 28 2015 14:16:55
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -41838,6 +41838,94 @@ Phaser.Pointer.prototype = {
|
|||
|
||||
},
|
||||
|
||||
/**
|
||||
* Called by updateButtons.
|
||||
*
|
||||
* @method Phaser.Pointer#processButtonsDown
|
||||
* @private
|
||||
* @param {integer} buttons - The DOM event.buttons property.
|
||||
* @param {MouseEvent} event - The DOM event.
|
||||
*/
|
||||
processButtonsDown: function (buttons, event) {
|
||||
|
||||
// Note: These are bitwise checks, not booleans
|
||||
|
||||
if (Phaser.Pointer.LEFT_BUTTON & buttons)
|
||||
{
|
||||
this.leftButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.RIGHT_BUTTON & buttons)
|
||||
{
|
||||
this.rightButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.MIDDLE_BUTTON & buttons)
|
||||
{
|
||||
this.middleButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.BACK_BUTTON & buttons)
|
||||
{
|
||||
this.backButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.FORWARD_BUTTON & buttons)
|
||||
{
|
||||
this.forwardButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.ERASER_BUTTON & buttons)
|
||||
{
|
||||
this.eraserButton.start(event);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Called by updateButtons.
|
||||
*
|
||||
* @method Phaser.Pointer#processButtonsUp
|
||||
* @private
|
||||
* @param {integer} buttons - The DOM event.buttons property.
|
||||
* @param {MouseEvent} event - The DOM event.
|
||||
*/
|
||||
processButtonsUp: function (button, event) {
|
||||
|
||||
// Note: These are bitwise checks, not booleans
|
||||
|
||||
if (button === Phaser.Mouse.LEFT_BUTTON)
|
||||
{
|
||||
this.leftButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.RIGHT_BUTTON)
|
||||
{
|
||||
this.rightButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.MIDDLE_BUTTON)
|
||||
{
|
||||
this.middleButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.BACK_BUTTON)
|
||||
{
|
||||
this.backButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.FORWARD_BUTTON)
|
||||
{
|
||||
this.forwardButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === 5)
|
||||
{
|
||||
this.eraserButton.stop(event);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Called when the event.buttons property changes from zero.
|
||||
* Contains a button bitmask.
|
||||
|
@ -41850,73 +41938,23 @@ Phaser.Pointer.prototype = {
|
|||
|
||||
this.button = event.button;
|
||||
|
||||
// This is tested back to IE9, but possibly some browsers may report this differently.
|
||||
// If you find one, please tell us!
|
||||
var buttons = event.buttons;
|
||||
var down = (event.type.toLowerCase().substr(-4) === 'down');
|
||||
|
||||
if (buttons !== undefined)
|
||||
if (event.buttons !== undefined)
|
||||
{
|
||||
// Note: These are bitwise checks, not booleans
|
||||
|
||||
if (Phaser.Pointer.LEFT_BUTTON & buttons)
|
||||
if (down)
|
||||
{
|
||||
this.leftButton.start(event);
|
||||
this.processButtonsDown(event.buttons, event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.leftButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.RIGHT_BUTTON & buttons)
|
||||
{
|
||||
this.rightButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.rightButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.MIDDLE_BUTTON & buttons)
|
||||
{
|
||||
this.middleButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.middleButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.BACK_BUTTON & buttons)
|
||||
{
|
||||
this.backButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.backButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.FORWARD_BUTTON & buttons)
|
||||
{
|
||||
this.forwardButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.forwardButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.ERASER_BUTTON & buttons)
|
||||
{
|
||||
this.eraserButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.eraserButton.stop(event);
|
||||
this.processButtonsUp(event.button, event);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// No buttons property (like Safari on OSX when using a trackpad)
|
||||
|
||||
if (event.type === 'mousedown')
|
||||
if (down)
|
||||
{
|
||||
this.leftButton.start(event);
|
||||
}
|
||||
|
@ -41929,6 +41967,7 @@ Phaser.Pointer.prototype = {
|
|||
|
||||
// On OS X (and other devices with trackpads) you have to press CTRL + the pad
|
||||
// to initiate a right-click event, so we'll check for that here
|
||||
|
||||
if (event.ctrlKey && this.leftButton.isDown)
|
||||
{
|
||||
this.rightButton.start(event);
|
||||
|
@ -41952,6 +41991,8 @@ Phaser.Pointer.prototype = {
|
|||
*/
|
||||
start: function (event) {
|
||||
|
||||
// console.log(event);
|
||||
|
||||
if (event['pointerId'])
|
||||
{
|
||||
this.pointerId = event.pointerId;
|
||||
|
@ -70832,6 +70873,10 @@ Phaser.Cache.prototype = {
|
|||
/**
|
||||
* Removes a sound from the cache.
|
||||
*
|
||||
* If any `Phaser.Sound` objects use the audio file in the cache that you remove with this method, they will
|
||||
* _automatically_ destroy themselves. If you wish to have full control over when Sounds are destroyed then
|
||||
* you must finish your house-keeping and destroy them all yourself first, before calling this method.
|
||||
*
|
||||
* Note that this only removes it from the Phaser.Cache. If you still have references to the data elsewhere
|
||||
* then it will persist in memory.
|
||||
*
|
||||
|
@ -74771,6 +74816,12 @@ Phaser.Sound.prototype = {
|
|||
*/
|
||||
update: function () {
|
||||
|
||||
if (!this.game.cache.checkSoundKey(this.key))
|
||||
{
|
||||
this.destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isDecoded && !this._onDecodedEventDispatched)
|
||||
{
|
||||
this.onDecoded.dispatch(this);
|
||||
|
|
File diff suppressed because one or more lines are too long
6
build/phaser.min.js
vendored
6
build/phaser.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -419,6 +419,94 @@ Phaser.Pointer.prototype = {
|
|||
|
||||
},
|
||||
|
||||
/**
|
||||
* Called by updateButtons.
|
||||
*
|
||||
* @method Phaser.Pointer#processButtonsDown
|
||||
* @private
|
||||
* @param {integer} buttons - The DOM event.buttons property.
|
||||
* @param {MouseEvent} event - The DOM event.
|
||||
*/
|
||||
processButtonsDown: function (buttons, event) {
|
||||
|
||||
// Note: These are bitwise checks, not booleans
|
||||
|
||||
if (Phaser.Pointer.LEFT_BUTTON & buttons)
|
||||
{
|
||||
this.leftButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.RIGHT_BUTTON & buttons)
|
||||
{
|
||||
this.rightButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.MIDDLE_BUTTON & buttons)
|
||||
{
|
||||
this.middleButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.BACK_BUTTON & buttons)
|
||||
{
|
||||
this.backButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.FORWARD_BUTTON & buttons)
|
||||
{
|
||||
this.forwardButton.start(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.ERASER_BUTTON & buttons)
|
||||
{
|
||||
this.eraserButton.start(event);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Called by updateButtons.
|
||||
*
|
||||
* @method Phaser.Pointer#processButtonsUp
|
||||
* @private
|
||||
* @param {integer} buttons - The DOM event.buttons property.
|
||||
* @param {MouseEvent} event - The DOM event.
|
||||
*/
|
||||
processButtonsUp: function (button, event) {
|
||||
|
||||
// Note: These are bitwise checks, not booleans
|
||||
|
||||
if (button === Phaser.Mouse.LEFT_BUTTON)
|
||||
{
|
||||
this.leftButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.RIGHT_BUTTON)
|
||||
{
|
||||
this.rightButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.MIDDLE_BUTTON)
|
||||
{
|
||||
this.middleButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.BACK_BUTTON)
|
||||
{
|
||||
this.backButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === Phaser.Mouse.FORWARD_BUTTON)
|
||||
{
|
||||
this.forwardButton.stop(event);
|
||||
}
|
||||
|
||||
if (button === 5)
|
||||
{
|
||||
this.eraserButton.stop(event);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Called when the event.buttons property changes from zero.
|
||||
* Contains a button bitmask.
|
||||
|
@ -431,73 +519,23 @@ Phaser.Pointer.prototype = {
|
|||
|
||||
this.button = event.button;
|
||||
|
||||
// This is tested back to IE9, but possibly some browsers may report this differently.
|
||||
// If you find one, please tell us!
|
||||
var buttons = event.buttons;
|
||||
var down = (event.type.toLowerCase().substr(-4) === 'down');
|
||||
|
||||
if (buttons !== undefined)
|
||||
if (event.buttons !== undefined)
|
||||
{
|
||||
// Note: These are bitwise checks, not booleans
|
||||
|
||||
if (Phaser.Pointer.LEFT_BUTTON & buttons)
|
||||
if (down)
|
||||
{
|
||||
this.leftButton.start(event);
|
||||
this.processButtonsDown(event.buttons, event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.leftButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.RIGHT_BUTTON & buttons)
|
||||
{
|
||||
this.rightButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.rightButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.MIDDLE_BUTTON & buttons)
|
||||
{
|
||||
this.middleButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.middleButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.BACK_BUTTON & buttons)
|
||||
{
|
||||
this.backButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.backButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.FORWARD_BUTTON & buttons)
|
||||
{
|
||||
this.forwardButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.forwardButton.stop(event);
|
||||
}
|
||||
|
||||
if (Phaser.Pointer.ERASER_BUTTON & buttons)
|
||||
{
|
||||
this.eraserButton.start(event);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.eraserButton.stop(event);
|
||||
this.processButtonsUp(event.button, event);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// No buttons property (like Safari on OSX when using a trackpad)
|
||||
|
||||
if (event.type === 'mousedown')
|
||||
if (down)
|
||||
{
|
||||
this.leftButton.start(event);
|
||||
}
|
||||
|
@ -510,6 +548,7 @@ Phaser.Pointer.prototype = {
|
|||
|
||||
// On OS X (and other devices with trackpads) you have to press CTRL + the pad
|
||||
// to initiate a right-click event, so we'll check for that here
|
||||
|
||||
if (event.ctrlKey && this.leftButton.isDown)
|
||||
{
|
||||
this.rightButton.start(event);
|
||||
|
@ -533,6 +572,8 @@ Phaser.Pointer.prototype = {
|
|||
*/
|
||||
start: function (event) {
|
||||
|
||||
// console.log(event);
|
||||
|
||||
if (event['pointerId'])
|
||||
{
|
||||
this.pointerId = event.pointerId;
|
||||
|
|
Loading…
Reference in a new issue