mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 20:53:39 +00:00
Phaser 2.4.9 RC1.
This commit is contained in:
parent
45bd98ee18
commit
1b7dcd9cbb
16 changed files with 328 additions and 204 deletions
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Phaser - http://phaser.io
|
||||
*
|
||||
* v2.4.9 "Four Kings" - Built: Thu Jun 02 2016 16:38:57
|
||||
* v2.4.9 "Four Kings" - Built: Thu Jun 02 2016 23:21:31
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -1855,7 +1855,7 @@ PIXI.Sprite.prototype._renderCanvas = function(renderSession, matrix)
|
|||
|
||||
renderSession.context.globalAlpha = this.worldAlpha;
|
||||
|
||||
// If smoothingEnabled is supported and we need to change the smoothing property for this texture
|
||||
// If smoothingEnabled is supported and we need to change the smoothing property for this texture
|
||||
if (renderSession.smoothProperty && renderSession.scaleMode !== this.texture.baseTexture.scaleMode)
|
||||
{
|
||||
renderSession.scaleMode = this.texture.baseTexture.scaleMode;
|
||||
|
@ -9152,7 +9152,7 @@ var Phaser = Phaser || {
|
|||
* @constant
|
||||
* @type {string}
|
||||
*/
|
||||
VERSION: '2.4.9-dev',
|
||||
VERSION: '2.4.9 RC1',
|
||||
|
||||
/**
|
||||
* An array of Phaser game instances.
|
||||
|
@ -14913,11 +14913,6 @@ Phaser.Camera.prototype = {
|
|||
this.updateFX();
|
||||
}
|
||||
|
||||
if (this.target)
|
||||
{
|
||||
this.updateTarget();
|
||||
}
|
||||
|
||||
if (this._shake.duration > 0)
|
||||
{
|
||||
this.updateShake();
|
||||
|
@ -14935,8 +14930,6 @@ Phaser.Camera.prototype = {
|
|||
this._shake.y = Math.floor(this._shake.y);
|
||||
}
|
||||
|
||||
// this.displayObject.position.x = -(this.view.x + this._shake.x);
|
||||
// this.displayObject.position.y = -(this.view.y + this._shake.y);
|
||||
this.displayObject.position.x = -this.view.x;
|
||||
this.displayObject.position.y = -this.view.y;
|
||||
|
||||
|
@ -15049,6 +15042,19 @@ Phaser.Camera.prototype = {
|
|||
this.view.y = this.game.math.linear(this.view.y, this._targetPosition.y - this.view.halfHeight, this.lerp.y);
|
||||
}
|
||||
|
||||
if (this.bounds)
|
||||
{
|
||||
this.checkBounds();
|
||||
}
|
||||
|
||||
if (this.roundPx)
|
||||
{
|
||||
this.view.floor();
|
||||
}
|
||||
|
||||
this.displayObject.position.x = -this.view.x;
|
||||
this.displayObject.position.y = -this.view.y;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -17885,7 +17891,6 @@ Phaser.Stage.prototype.preUpdate = function () {
|
|||
|
||||
this.currentRenderOrderID = 0;
|
||||
|
||||
// This can't loop in reverse, we need the orderID to be in sequence
|
||||
for (var i = 0; i < this.children.length; i++)
|
||||
{
|
||||
this.children[i].preUpdate();
|
||||
|
@ -17900,9 +17905,7 @@ Phaser.Stage.prototype.preUpdate = function () {
|
|||
*/
|
||||
Phaser.Stage.prototype.update = function () {
|
||||
|
||||
var i = this.children.length;
|
||||
|
||||
while (i--)
|
||||
for (var i = 0; i < this.children.length; i++)
|
||||
{
|
||||
this.children[i].update();
|
||||
}
|
||||
|
@ -17913,22 +17916,25 @@ Phaser.Stage.prototype.update = function () {
|
|||
* This is called automatically before the renderer runs and after the plugins have updated.
|
||||
* In postUpdate this is where all the final physics calculations and object positioning happens.
|
||||
* The objects are processed in the order of the display list.
|
||||
* The only exception to this is if the camera is following an object, in which case that is updated first.
|
||||
*
|
||||
* @method Phaser.Stage#postUpdate
|
||||
*/
|
||||
Phaser.Stage.prototype.postUpdate = function () {
|
||||
|
||||
var i = this.children.length;
|
||||
// Apply the camera shake, fade, bounds, etc
|
||||
this.game.camera.update();
|
||||
|
||||
while (i--)
|
||||
for (var i = 0; i < this.children.length; i++)
|
||||
{
|
||||
this.children[i].postUpdate();
|
||||
}
|
||||
|
||||
this.updateTransform();
|
||||
|
||||
this.game.world.camera.update();
|
||||
if (this.game.camera.target)
|
||||
{
|
||||
this.game.camera.updateTarget();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
@ -21711,9 +21717,6 @@ Phaser.Game.prototype = {
|
|||
{
|
||||
this.updateLogic(this.time.desiredFpsMult);
|
||||
|
||||
// Sync the scene graph after _every_ logic update to account for moved game objects
|
||||
this.stage.updateTransform();
|
||||
|
||||
// call the game render update exactly once every frame
|
||||
this.updateRender(this.time.slowMotion * this.time.desiredFps);
|
||||
|
||||
|
@ -21768,9 +21771,6 @@ Phaser.Game.prototype = {
|
|||
|
||||
this.updateLogic(this.time.desiredFpsMult);
|
||||
|
||||
// Sync the scene graph after _every_ logic update to account for moved game objects
|
||||
this.stage.updateTransform();
|
||||
|
||||
count++;
|
||||
|
||||
if (this.forceSingleUpdate && count === 1)
|
||||
|
@ -21820,7 +21820,7 @@ Phaser.Game.prototype = {
|
|||
|
||||
this.scale.preUpdate();
|
||||
this.debug.preUpdate();
|
||||
this.world.camera.preUpdate();
|
||||
this.camera.preUpdate();
|
||||
this.physics.preUpdate();
|
||||
this.state.preUpdate(timeStep);
|
||||
this.plugins.preUpdate(timeStep);
|
||||
|
@ -21846,6 +21846,8 @@ Phaser.Game.prototype = {
|
|||
this.debug.preUpdate();
|
||||
}
|
||||
|
||||
this.stage.updateTransform();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -75120,16 +75122,54 @@ Phaser.TilemapLayer.prototype.preUpdate = function() {
|
|||
*/
|
||||
Phaser.TilemapLayer.prototype.postUpdate = function () {
|
||||
|
||||
Phaser.Component.FixedToCamera.postUpdate.call(this);
|
||||
this.position.x = (this.game.camera.view.x + this.cameraOffset.x) / this.game.camera.scale.x;
|
||||
this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y;
|
||||
|
||||
// Stops you being able to auto-scroll the camera if it's not following a sprite
|
||||
var camera = this.game.camera;
|
||||
this._scrollX = this.game.camera.view.x * this.scrollFactorX / this.scale.x;
|
||||
this._scrollY = this.game.camera.view.y * this.scrollFactorY / this.scale.y;
|
||||
|
||||
this.scrollX = camera.x * this.scrollFactorX / this.scale.x;
|
||||
this.scrollY = camera.y * this.scrollFactorY / this.scale.y;
|
||||
};
|
||||
|
||||
/**
|
||||
* Automatically called by the Canvas Renderer.
|
||||
* Overrides the Sprite._renderCanvas function.
|
||||
*
|
||||
* @method Phaser.TilemapLayer#_renderCanvas
|
||||
* @private
|
||||
*/
|
||||
Phaser.TilemapLayer.prototype._renderCanvas = function (renderSession) {
|
||||
|
||||
this.position.x = (this.game.camera.view.x + this.cameraOffset.x) / this.game.camera.scale.x;
|
||||
this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y;
|
||||
|
||||
this._scrollX = this.game.camera.view.x * this.scrollFactorX / this.scale.x;
|
||||
this._scrollY = this.game.camera.view.y * this.scrollFactorY / this.scale.y;
|
||||
|
||||
this.render();
|
||||
|
||||
PIXI.Sprite.prototype._renderCanvas.call(this, renderSession);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Automatically called by the Canvas Renderer.
|
||||
* Overrides the Sprite._renderWebGL function.
|
||||
*
|
||||
* @method Phaser.TilemapLayer#_renderWebGL
|
||||
* @private
|
||||
*/
|
||||
Phaser.TilemapLayer.prototype._renderWebGL = function (renderSession) {
|
||||
|
||||
this.position.x = (this.game.camera.view.x + this.cameraOffset.x) / this.game.camera.scale.x;
|
||||
this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y;
|
||||
|
||||
this._scrollX = this.game.camera.view.x * this.scrollFactorX / this.scale.x;
|
||||
this._scrollY = this.game.camera.view.y * this.scrollFactorY / this.scale.y;
|
||||
|
||||
this.render();
|
||||
|
||||
PIXI.Sprite.prototype._renderWebGL.call(this, renderSession);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because one or more lines are too long
14
build/custom/phaser-arcade-physics.min.js
vendored
14
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.9 "Four Kings" - Built: Thu Jun 02 2016 16:39:14
|
||||
* v2.4.9 "Four Kings" - Built: Thu Jun 02 2016 23:21:52
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -1855,7 +1855,7 @@ PIXI.Sprite.prototype._renderCanvas = function(renderSession, matrix)
|
|||
|
||||
renderSession.context.globalAlpha = this.worldAlpha;
|
||||
|
||||
// If smoothingEnabled is supported and we need to change the smoothing property for this texture
|
||||
// If smoothingEnabled is supported and we need to change the smoothing property for this texture
|
||||
if (renderSession.smoothProperty && renderSession.scaleMode !== this.texture.baseTexture.scaleMode)
|
||||
{
|
||||
renderSession.scaleMode = this.texture.baseTexture.scaleMode;
|
||||
|
@ -7952,7 +7952,7 @@ var Phaser = Phaser || {
|
|||
* @constant
|
||||
* @type {string}
|
||||
*/
|
||||
VERSION: '2.4.9-dev',
|
||||
VERSION: '2.4.9 RC1',
|
||||
|
||||
/**
|
||||
* An array of Phaser game instances.
|
||||
|
@ -13713,11 +13713,6 @@ Phaser.Camera.prototype = {
|
|||
this.updateFX();
|
||||
}
|
||||
|
||||
if (this.target)
|
||||
{
|
||||
this.updateTarget();
|
||||
}
|
||||
|
||||
if (this._shake.duration > 0)
|
||||
{
|
||||
this.updateShake();
|
||||
|
@ -13735,8 +13730,6 @@ Phaser.Camera.prototype = {
|
|||
this._shake.y = Math.floor(this._shake.y);
|
||||
}
|
||||
|
||||
// this.displayObject.position.x = -(this.view.x + this._shake.x);
|
||||
// this.displayObject.position.y = -(this.view.y + this._shake.y);
|
||||
this.displayObject.position.x = -this.view.x;
|
||||
this.displayObject.position.y = -this.view.y;
|
||||
|
||||
|
@ -13849,6 +13842,19 @@ Phaser.Camera.prototype = {
|
|||
this.view.y = this.game.math.linear(this.view.y, this._targetPosition.y - this.view.halfHeight, this.lerp.y);
|
||||
}
|
||||
|
||||
if (this.bounds)
|
||||
{
|
||||
this.checkBounds();
|
||||
}
|
||||
|
||||
if (this.roundPx)
|
||||
{
|
||||
this.view.floor();
|
||||
}
|
||||
|
||||
this.displayObject.position.x = -this.view.x;
|
||||
this.displayObject.position.y = -this.view.y;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -16685,7 +16691,6 @@ Phaser.Stage.prototype.preUpdate = function () {
|
|||
|
||||
this.currentRenderOrderID = 0;
|
||||
|
||||
// This can't loop in reverse, we need the orderID to be in sequence
|
||||
for (var i = 0; i < this.children.length; i++)
|
||||
{
|
||||
this.children[i].preUpdate();
|
||||
|
@ -16700,9 +16705,7 @@ Phaser.Stage.prototype.preUpdate = function () {
|
|||
*/
|
||||
Phaser.Stage.prototype.update = function () {
|
||||
|
||||
var i = this.children.length;
|
||||
|
||||
while (i--)
|
||||
for (var i = 0; i < this.children.length; i++)
|
||||
{
|
||||
this.children[i].update();
|
||||
}
|
||||
|
@ -16713,22 +16716,25 @@ Phaser.Stage.prototype.update = function () {
|
|||
* This is called automatically before the renderer runs and after the plugins have updated.
|
||||
* In postUpdate this is where all the final physics calculations and object positioning happens.
|
||||
* The objects are processed in the order of the display list.
|
||||
* The only exception to this is if the camera is following an object, in which case that is updated first.
|
||||
*
|
||||
* @method Phaser.Stage#postUpdate
|
||||
*/
|
||||
Phaser.Stage.prototype.postUpdate = function () {
|
||||
|
||||
var i = this.children.length;
|
||||
// Apply the camera shake, fade, bounds, etc
|
||||
this.game.camera.update();
|
||||
|
||||
while (i--)
|
||||
for (var i = 0; i < this.children.length; i++)
|
||||
{
|
||||
this.children[i].postUpdate();
|
||||
}
|
||||
|
||||
this.updateTransform();
|
||||
|
||||
this.game.world.camera.update();
|
||||
if (this.game.camera.target)
|
||||
{
|
||||
this.game.camera.updateTarget();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
@ -20511,9 +20517,6 @@ Phaser.Game.prototype = {
|
|||
{
|
||||
this.updateLogic(this.time.desiredFpsMult);
|
||||
|
||||
// Sync the scene graph after _every_ logic update to account for moved game objects
|
||||
this.stage.updateTransform();
|
||||
|
||||
// call the game render update exactly once every frame
|
||||
this.updateRender(this.time.slowMotion * this.time.desiredFps);
|
||||
|
||||
|
@ -20568,9 +20571,6 @@ Phaser.Game.prototype = {
|
|||
|
||||
this.updateLogic(this.time.desiredFpsMult);
|
||||
|
||||
// Sync the scene graph after _every_ logic update to account for moved game objects
|
||||
this.stage.updateTransform();
|
||||
|
||||
count++;
|
||||
|
||||
if (this.forceSingleUpdate && count === 1)
|
||||
|
@ -20620,7 +20620,7 @@ Phaser.Game.prototype = {
|
|||
|
||||
this.scale.preUpdate();
|
||||
this.debug.preUpdate();
|
||||
this.world.camera.preUpdate();
|
||||
this.camera.preUpdate();
|
||||
this.physics.preUpdate();
|
||||
this.state.preUpdate(timeStep);
|
||||
this.plugins.preUpdate(timeStep);
|
||||
|
@ -20646,6 +20646,8 @@ Phaser.Game.prototype = {
|
|||
this.debug.preUpdate();
|
||||
}
|
||||
|
||||
this.stage.updateTransform();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because one or more lines are too long
20
build/custom/phaser-minimum.min.js
vendored
20
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.9 "Four Kings" - Built: Thu Jun 02 2016 16:39:06
|
||||
* v2.4.9 "Four Kings" - Built: Thu Jun 02 2016 23:21:42
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -1855,7 +1855,7 @@ PIXI.Sprite.prototype._renderCanvas = function(renderSession, matrix)
|
|||
|
||||
renderSession.context.globalAlpha = this.worldAlpha;
|
||||
|
||||
// If smoothingEnabled is supported and we need to change the smoothing property for this texture
|
||||
// If smoothingEnabled is supported and we need to change the smoothing property for this texture
|
||||
if (renderSession.smoothProperty && renderSession.scaleMode !== this.texture.baseTexture.scaleMode)
|
||||
{
|
||||
renderSession.scaleMode = this.texture.baseTexture.scaleMode;
|
||||
|
@ -9152,7 +9152,7 @@ var Phaser = Phaser || {
|
|||
* @constant
|
||||
* @type {string}
|
||||
*/
|
||||
VERSION: '2.4.9-dev',
|
||||
VERSION: '2.4.9 RC1',
|
||||
|
||||
/**
|
||||
* An array of Phaser game instances.
|
||||
|
@ -14913,11 +14913,6 @@ Phaser.Camera.prototype = {
|
|||
this.updateFX();
|
||||
}
|
||||
|
||||
if (this.target)
|
||||
{
|
||||
this.updateTarget();
|
||||
}
|
||||
|
||||
if (this._shake.duration > 0)
|
||||
{
|
||||
this.updateShake();
|
||||
|
@ -14935,8 +14930,6 @@ Phaser.Camera.prototype = {
|
|||
this._shake.y = Math.floor(this._shake.y);
|
||||
}
|
||||
|
||||
// this.displayObject.position.x = -(this.view.x + this._shake.x);
|
||||
// this.displayObject.position.y = -(this.view.y + this._shake.y);
|
||||
this.displayObject.position.x = -this.view.x;
|
||||
this.displayObject.position.y = -this.view.y;
|
||||
|
||||
|
@ -15049,6 +15042,19 @@ Phaser.Camera.prototype = {
|
|||
this.view.y = this.game.math.linear(this.view.y, this._targetPosition.y - this.view.halfHeight, this.lerp.y);
|
||||
}
|
||||
|
||||
if (this.bounds)
|
||||
{
|
||||
this.checkBounds();
|
||||
}
|
||||
|
||||
if (this.roundPx)
|
||||
{
|
||||
this.view.floor();
|
||||
}
|
||||
|
||||
this.displayObject.position.x = -this.view.x;
|
||||
this.displayObject.position.y = -this.view.y;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -17885,7 +17891,6 @@ Phaser.Stage.prototype.preUpdate = function () {
|
|||
|
||||
this.currentRenderOrderID = 0;
|
||||
|
||||
// This can't loop in reverse, we need the orderID to be in sequence
|
||||
for (var i = 0; i < this.children.length; i++)
|
||||
{
|
||||
this.children[i].preUpdate();
|
||||
|
@ -17900,9 +17905,7 @@ Phaser.Stage.prototype.preUpdate = function () {
|
|||
*/
|
||||
Phaser.Stage.prototype.update = function () {
|
||||
|
||||
var i = this.children.length;
|
||||
|
||||
while (i--)
|
||||
for (var i = 0; i < this.children.length; i++)
|
||||
{
|
||||
this.children[i].update();
|
||||
}
|
||||
|
@ -17913,22 +17916,25 @@ Phaser.Stage.prototype.update = function () {
|
|||
* This is called automatically before the renderer runs and after the plugins have updated.
|
||||
* In postUpdate this is where all the final physics calculations and object positioning happens.
|
||||
* The objects are processed in the order of the display list.
|
||||
* The only exception to this is if the camera is following an object, in which case that is updated first.
|
||||
*
|
||||
* @method Phaser.Stage#postUpdate
|
||||
*/
|
||||
Phaser.Stage.prototype.postUpdate = function () {
|
||||
|
||||
var i = this.children.length;
|
||||
// Apply the camera shake, fade, bounds, etc
|
||||
this.game.camera.update();
|
||||
|
||||
while (i--)
|
||||
for (var i = 0; i < this.children.length; i++)
|
||||
{
|
||||
this.children[i].postUpdate();
|
||||
}
|
||||
|
||||
this.updateTransform();
|
||||
|
||||
this.game.world.camera.update();
|
||||
if (this.game.camera.target)
|
||||
{
|
||||
this.game.camera.updateTarget();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
@ -21711,9 +21717,6 @@ Phaser.Game.prototype = {
|
|||
{
|
||||
this.updateLogic(this.time.desiredFpsMult);
|
||||
|
||||
// Sync the scene graph after _every_ logic update to account for moved game objects
|
||||
this.stage.updateTransform();
|
||||
|
||||
// call the game render update exactly once every frame
|
||||
this.updateRender(this.time.slowMotion * this.time.desiredFps);
|
||||
|
||||
|
@ -21768,9 +21771,6 @@ Phaser.Game.prototype = {
|
|||
|
||||
this.updateLogic(this.time.desiredFpsMult);
|
||||
|
||||
// Sync the scene graph after _every_ logic update to account for moved game objects
|
||||
this.stage.updateTransform();
|
||||
|
||||
count++;
|
||||
|
||||
if (this.forceSingleUpdate && count === 1)
|
||||
|
@ -21820,7 +21820,7 @@ Phaser.Game.prototype = {
|
|||
|
||||
this.scale.preUpdate();
|
||||
this.debug.preUpdate();
|
||||
this.world.camera.preUpdate();
|
||||
this.camera.preUpdate();
|
||||
this.physics.preUpdate();
|
||||
this.state.preUpdate(timeStep);
|
||||
this.plugins.preUpdate(timeStep);
|
||||
|
@ -21846,6 +21846,8 @@ Phaser.Game.prototype = {
|
|||
this.debug.preUpdate();
|
||||
}
|
||||
|
||||
this.stage.updateTransform();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because one or more lines are too long
10
build/custom/phaser-no-physics.min.js
vendored
10
build/custom/phaser-no-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.9 "Four Kings" - Built: Thu Jun 02 2016 16:39:22
|
||||
* v2.4.9 "Four Kings" - Built: Thu Jun 02 2016 23:22:02
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -55,7 +55,7 @@ var Phaser = Phaser || {
|
|||
* @constant
|
||||
* @type {string}
|
||||
*/
|
||||
VERSION: '2.4.9-dev',
|
||||
VERSION: '2.4.9 RC1',
|
||||
|
||||
/**
|
||||
* An array of Phaser game instances.
|
||||
|
@ -5816,11 +5816,6 @@ Phaser.Camera.prototype = {
|
|||
this.updateFX();
|
||||
}
|
||||
|
||||
if (this.target)
|
||||
{
|
||||
this.updateTarget();
|
||||
}
|
||||
|
||||
if (this._shake.duration > 0)
|
||||
{
|
||||
this.updateShake();
|
||||
|
@ -5838,8 +5833,6 @@ Phaser.Camera.prototype = {
|
|||
this._shake.y = Math.floor(this._shake.y);
|
||||
}
|
||||
|
||||
// this.displayObject.position.x = -(this.view.x + this._shake.x);
|
||||
// this.displayObject.position.y = -(this.view.y + this._shake.y);
|
||||
this.displayObject.position.x = -this.view.x;
|
||||
this.displayObject.position.y = -this.view.y;
|
||||
|
||||
|
@ -5952,6 +5945,19 @@ Phaser.Camera.prototype = {
|
|||
this.view.y = this.game.math.linear(this.view.y, this._targetPosition.y - this.view.halfHeight, this.lerp.y);
|
||||
}
|
||||
|
||||
if (this.bounds)
|
||||
{
|
||||
this.checkBounds();
|
||||
}
|
||||
|
||||
if (this.roundPx)
|
||||
{
|
||||
this.view.floor();
|
||||
}
|
||||
|
||||
this.displayObject.position.x = -this.view.x;
|
||||
this.displayObject.position.y = -this.view.y;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -8788,7 +8794,6 @@ Phaser.Stage.prototype.preUpdate = function () {
|
|||
|
||||
this.currentRenderOrderID = 0;
|
||||
|
||||
// This can't loop in reverse, we need the orderID to be in sequence
|
||||
for (var i = 0; i < this.children.length; i++)
|
||||
{
|
||||
this.children[i].preUpdate();
|
||||
|
@ -8803,9 +8808,7 @@ Phaser.Stage.prototype.preUpdate = function () {
|
|||
*/
|
||||
Phaser.Stage.prototype.update = function () {
|
||||
|
||||
var i = this.children.length;
|
||||
|
||||
while (i--)
|
||||
for (var i = 0; i < this.children.length; i++)
|
||||
{
|
||||
this.children[i].update();
|
||||
}
|
||||
|
@ -8816,22 +8819,25 @@ Phaser.Stage.prototype.update = function () {
|
|||
* This is called automatically before the renderer runs and after the plugins have updated.
|
||||
* In postUpdate this is where all the final physics calculations and object positioning happens.
|
||||
* The objects are processed in the order of the display list.
|
||||
* The only exception to this is if the camera is following an object, in which case that is updated first.
|
||||
*
|
||||
* @method Phaser.Stage#postUpdate
|
||||
*/
|
||||
Phaser.Stage.prototype.postUpdate = function () {
|
||||
|
||||
var i = this.children.length;
|
||||
// Apply the camera shake, fade, bounds, etc
|
||||
this.game.camera.update();
|
||||
|
||||
while (i--)
|
||||
for (var i = 0; i < this.children.length; i++)
|
||||
{
|
||||
this.children[i].postUpdate();
|
||||
}
|
||||
|
||||
this.updateTransform();
|
||||
|
||||
this.game.world.camera.update();
|
||||
if (this.game.camera.target)
|
||||
{
|
||||
this.game.camera.updateTarget();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
@ -12614,9 +12620,6 @@ Phaser.Game.prototype = {
|
|||
{
|
||||
this.updateLogic(this.time.desiredFpsMult);
|
||||
|
||||
// Sync the scene graph after _every_ logic update to account for moved game objects
|
||||
this.stage.updateTransform();
|
||||
|
||||
// call the game render update exactly once every frame
|
||||
this.updateRender(this.time.slowMotion * this.time.desiredFps);
|
||||
|
||||
|
@ -12671,9 +12674,6 @@ Phaser.Game.prototype = {
|
|||
|
||||
this.updateLogic(this.time.desiredFpsMult);
|
||||
|
||||
// Sync the scene graph after _every_ logic update to account for moved game objects
|
||||
this.stage.updateTransform();
|
||||
|
||||
count++;
|
||||
|
||||
if (this.forceSingleUpdate && count === 1)
|
||||
|
@ -12723,7 +12723,7 @@ Phaser.Game.prototype = {
|
|||
|
||||
this.scale.preUpdate();
|
||||
this.debug.preUpdate();
|
||||
this.world.camera.preUpdate();
|
||||
this.camera.preUpdate();
|
||||
this.physics.preUpdate();
|
||||
this.state.preUpdate(timeStep);
|
||||
this.plugins.preUpdate(timeStep);
|
||||
|
@ -12749,6 +12749,8 @@ Phaser.Game.prototype = {
|
|||
this.debug.preUpdate();
|
||||
}
|
||||
|
||||
this.stage.updateTransform();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -71450,16 +71452,54 @@ Phaser.TilemapLayer.prototype.preUpdate = function() {
|
|||
*/
|
||||
Phaser.TilemapLayer.prototype.postUpdate = function () {
|
||||
|
||||
Phaser.Component.FixedToCamera.postUpdate.call(this);
|
||||
this.position.x = (this.game.camera.view.x + this.cameraOffset.x) / this.game.camera.scale.x;
|
||||
this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y;
|
||||
|
||||
// Stops you being able to auto-scroll the camera if it's not following a sprite
|
||||
var camera = this.game.camera;
|
||||
this._scrollX = this.game.camera.view.x * this.scrollFactorX / this.scale.x;
|
||||
this._scrollY = this.game.camera.view.y * this.scrollFactorY / this.scale.y;
|
||||
|
||||
this.scrollX = camera.x * this.scrollFactorX / this.scale.x;
|
||||
this.scrollY = camera.y * this.scrollFactorY / this.scale.y;
|
||||
};
|
||||
|
||||
/**
|
||||
* Automatically called by the Canvas Renderer.
|
||||
* Overrides the Sprite._renderCanvas function.
|
||||
*
|
||||
* @method Phaser.TilemapLayer#_renderCanvas
|
||||
* @private
|
||||
*/
|
||||
Phaser.TilemapLayer.prototype._renderCanvas = function (renderSession) {
|
||||
|
||||
this.position.x = (this.game.camera.view.x + this.cameraOffset.x) / this.game.camera.scale.x;
|
||||
this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y;
|
||||
|
||||
this._scrollX = this.game.camera.view.x * this.scrollFactorX / this.scale.x;
|
||||
this._scrollY = this.game.camera.view.y * this.scrollFactorY / this.scale.y;
|
||||
|
||||
this.render();
|
||||
|
||||
PIXI.Sprite.prototype._renderCanvas.call(this, renderSession);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Automatically called by the Canvas Renderer.
|
||||
* Overrides the Sprite._renderWebGL function.
|
||||
*
|
||||
* @method Phaser.TilemapLayer#_renderWebGL
|
||||
* @private
|
||||
*/
|
||||
Phaser.TilemapLayer.prototype._renderWebGL = function (renderSession) {
|
||||
|
||||
this.position.x = (this.game.camera.view.x + this.cameraOffset.x) / this.game.camera.scale.x;
|
||||
this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y;
|
||||
|
||||
this._scrollX = this.game.camera.view.x * this.scrollFactorX / this.scale.x;
|
||||
this._scrollY = this.game.camera.view.y * this.scrollFactorY / this.scale.y;
|
||||
|
||||
this.render();
|
||||
|
||||
PIXI.Sprite.prototype._renderWebGL.call(this, renderSession);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because one or more lines are too long
36
build/custom/phaser-split.min.js
vendored
36
build/custom/phaser-split.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Phaser - http://phaser.io
|
||||
*
|
||||
* v2.4.9 "Four Kings" - Built: Thu Jun 02 2016 16:39:21
|
||||
* v2.4.9 "Four Kings" - Built: Thu Jun 02 2016 23:22:01
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -1855,7 +1855,7 @@ PIXI.Sprite.prototype._renderCanvas = function(renderSession, matrix)
|
|||
|
||||
renderSession.context.globalAlpha = this.worldAlpha;
|
||||
|
||||
// If smoothingEnabled is supported and we need to change the smoothing property for this texture
|
||||
// If smoothingEnabled is supported and we need to change the smoothing property for this texture
|
||||
if (renderSession.smoothProperty && renderSession.scaleMode !== this.texture.baseTexture.scaleMode)
|
||||
{
|
||||
renderSession.scaleMode = this.texture.baseTexture.scaleMode;
|
||||
|
|
100
build/phaser.js
100
build/phaser.js
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
* Phaser - http://phaser.io
|
||||
*
|
||||
* v2.4.9 "Four Kings" - Built: Thu Jun 02 2016 16:38:43
|
||||
* v2.4.9 "Four Kings" - Built: Thu Jun 02 2016 23:21:16
|
||||
*
|
||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||
*
|
||||
|
@ -15468,7 +15468,7 @@ PIXI.Sprite.prototype._renderCanvas = function(renderSession, matrix)
|
|||
|
||||
renderSession.context.globalAlpha = this.worldAlpha;
|
||||
|
||||
// If smoothingEnabled is supported and we need to change the smoothing property for this texture
|
||||
// If smoothingEnabled is supported and we need to change the smoothing property for this texture
|
||||
if (renderSession.smoothProperty && renderSession.scaleMode !== this.texture.baseTexture.scaleMode)
|
||||
{
|
||||
renderSession.scaleMode = this.texture.baseTexture.scaleMode;
|
||||
|
@ -22765,7 +22765,7 @@ var Phaser = Phaser || {
|
|||
* @constant
|
||||
* @type {string}
|
||||
*/
|
||||
VERSION: '2.4.9-dev',
|
||||
VERSION: '2.4.9 RC1',
|
||||
|
||||
/**
|
||||
* An array of Phaser game instances.
|
||||
|
@ -28526,11 +28526,6 @@ Phaser.Camera.prototype = {
|
|||
this.updateFX();
|
||||
}
|
||||
|
||||
if (this.target)
|
||||
{
|
||||
this.updateTarget();
|
||||
}
|
||||
|
||||
if (this._shake.duration > 0)
|
||||
{
|
||||
this.updateShake();
|
||||
|
@ -28548,8 +28543,6 @@ Phaser.Camera.prototype = {
|
|||
this._shake.y = Math.floor(this._shake.y);
|
||||
}
|
||||
|
||||
// this.displayObject.position.x = -(this.view.x + this._shake.x);
|
||||
// this.displayObject.position.y = -(this.view.y + this._shake.y);
|
||||
this.displayObject.position.x = -this.view.x;
|
||||
this.displayObject.position.y = -this.view.y;
|
||||
|
||||
|
@ -28662,6 +28655,19 @@ Phaser.Camera.prototype = {
|
|||
this.view.y = this.game.math.linear(this.view.y, this._targetPosition.y - this.view.halfHeight, this.lerp.y);
|
||||
}
|
||||
|
||||
if (this.bounds)
|
||||
{
|
||||
this.checkBounds();
|
||||
}
|
||||
|
||||
if (this.roundPx)
|
||||
{
|
||||
this.view.floor();
|
||||
}
|
||||
|
||||
this.displayObject.position.x = -this.view.x;
|
||||
this.displayObject.position.y = -this.view.y;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -31498,7 +31504,6 @@ Phaser.Stage.prototype.preUpdate = function () {
|
|||
|
||||
this.currentRenderOrderID = 0;
|
||||
|
||||
// This can't loop in reverse, we need the orderID to be in sequence
|
||||
for (var i = 0; i < this.children.length; i++)
|
||||
{
|
||||
this.children[i].preUpdate();
|
||||
|
@ -31513,9 +31518,7 @@ Phaser.Stage.prototype.preUpdate = function () {
|
|||
*/
|
||||
Phaser.Stage.prototype.update = function () {
|
||||
|
||||
var i = this.children.length;
|
||||
|
||||
while (i--)
|
||||
for (var i = 0; i < this.children.length; i++)
|
||||
{
|
||||
this.children[i].update();
|
||||
}
|
||||
|
@ -31526,22 +31529,25 @@ Phaser.Stage.prototype.update = function () {
|
|||
* This is called automatically before the renderer runs and after the plugins have updated.
|
||||
* In postUpdate this is where all the final physics calculations and object positioning happens.
|
||||
* The objects are processed in the order of the display list.
|
||||
* The only exception to this is if the camera is following an object, in which case that is updated first.
|
||||
*
|
||||
* @method Phaser.Stage#postUpdate
|
||||
*/
|
||||
Phaser.Stage.prototype.postUpdate = function () {
|
||||
|
||||
var i = this.children.length;
|
||||
// Apply the camera shake, fade, bounds, etc
|
||||
this.game.camera.update();
|
||||
|
||||
while (i--)
|
||||
for (var i = 0; i < this.children.length; i++)
|
||||
{
|
||||
this.children[i].postUpdate();
|
||||
}
|
||||
|
||||
this.updateTransform();
|
||||
|
||||
this.game.world.camera.update();
|
||||
if (this.game.camera.target)
|
||||
{
|
||||
this.game.camera.updateTarget();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
@ -35324,9 +35330,6 @@ Phaser.Game.prototype = {
|
|||
{
|
||||
this.updateLogic(this.time.desiredFpsMult);
|
||||
|
||||
// Sync the scene graph after _every_ logic update to account for moved game objects
|
||||
this.stage.updateTransform();
|
||||
|
||||
// call the game render update exactly once every frame
|
||||
this.updateRender(this.time.slowMotion * this.time.desiredFps);
|
||||
|
||||
|
@ -35381,9 +35384,6 @@ Phaser.Game.prototype = {
|
|||
|
||||
this.updateLogic(this.time.desiredFpsMult);
|
||||
|
||||
// Sync the scene graph after _every_ logic update to account for moved game objects
|
||||
this.stage.updateTransform();
|
||||
|
||||
count++;
|
||||
|
||||
if (this.forceSingleUpdate && count === 1)
|
||||
|
@ -35433,7 +35433,7 @@ Phaser.Game.prototype = {
|
|||
|
||||
this.scale.preUpdate();
|
||||
this.debug.preUpdate();
|
||||
this.world.camera.preUpdate();
|
||||
this.camera.preUpdate();
|
||||
this.physics.preUpdate();
|
||||
this.state.preUpdate(timeStep);
|
||||
this.plugins.preUpdate(timeStep);
|
||||
|
@ -35459,6 +35459,8 @@ Phaser.Game.prototype = {
|
|||
this.debug.preUpdate();
|
||||
}
|
||||
|
||||
this.stage.updateTransform();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -94160,16 +94162,54 @@ Phaser.TilemapLayer.prototype.preUpdate = function() {
|
|||
*/
|
||||
Phaser.TilemapLayer.prototype.postUpdate = function () {
|
||||
|
||||
Phaser.Component.FixedToCamera.postUpdate.call(this);
|
||||
this.position.x = (this.game.camera.view.x + this.cameraOffset.x) / this.game.camera.scale.x;
|
||||
this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y;
|
||||
|
||||
// Stops you being able to auto-scroll the camera if it's not following a sprite
|
||||
var camera = this.game.camera;
|
||||
this._scrollX = this.game.camera.view.x * this.scrollFactorX / this.scale.x;
|
||||
this._scrollY = this.game.camera.view.y * this.scrollFactorY / this.scale.y;
|
||||
|
||||
this.scrollX = camera.x * this.scrollFactorX / this.scale.x;
|
||||
this.scrollY = camera.y * this.scrollFactorY / this.scale.y;
|
||||
};
|
||||
|
||||
/**
|
||||
* Automatically called by the Canvas Renderer.
|
||||
* Overrides the Sprite._renderCanvas function.
|
||||
*
|
||||
* @method Phaser.TilemapLayer#_renderCanvas
|
||||
* @private
|
||||
*/
|
||||
Phaser.TilemapLayer.prototype._renderCanvas = function (renderSession) {
|
||||
|
||||
this.position.x = (this.game.camera.view.x + this.cameraOffset.x) / this.game.camera.scale.x;
|
||||
this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y;
|
||||
|
||||
this._scrollX = this.game.camera.view.x * this.scrollFactorX / this.scale.x;
|
||||
this._scrollY = this.game.camera.view.y * this.scrollFactorY / this.scale.y;
|
||||
|
||||
this.render();
|
||||
|
||||
PIXI.Sprite.prototype._renderCanvas.call(this, renderSession);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Automatically called by the Canvas Renderer.
|
||||
* Overrides the Sprite._renderWebGL function.
|
||||
*
|
||||
* @method Phaser.TilemapLayer#_renderWebGL
|
||||
* @private
|
||||
*/
|
||||
Phaser.TilemapLayer.prototype._renderWebGL = function (renderSession) {
|
||||
|
||||
this.position.x = (this.game.camera.view.x + this.cameraOffset.x) / this.game.camera.scale.x;
|
||||
this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y;
|
||||
|
||||
this._scrollX = this.game.camera.view.x * this.scrollFactorX / this.scale.x;
|
||||
this._scrollY = this.game.camera.view.y * this.scrollFactorY / this.scale.y;
|
||||
|
||||
this.render();
|
||||
|
||||
PIXI.Sprite.prototype._renderWebGL.call(this, renderSession);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because one or more lines are too long
36
build/phaser.min.js
vendored
36
build/phaser.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue