mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 20:53:39 +00:00
Phaser 2.4.7 RC1.
This commit is contained in:
parent
ac4acfb912
commit
41add1b4bf
21 changed files with 6402 additions and 2624 deletions
|
@ -350,14 +350,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
|
||||||
* Camera.fade is a new function that makes the camera fade to the color given, over the course of the duration specified. This is great for things like transitioning from one State to another. You can listen for the Camera.onFadeComplete Signal.
|
* Camera.fade is a new function that makes the camera fade to the color given, over the course of the duration specified. This is great for things like transitioning from one State to another. You can listen for the Camera.onFadeComplete Signal.
|
||||||
* Camera.resetFX resets any active FX, such as a fade or flash and immediately clears it. Useful for calling after a fade in order to remove the fade from the Stage.
|
* Camera.resetFX resets any active FX, such as a fade or flash and immediately clears it. Useful for calling after a fade in order to remove the fade from the Stage.
|
||||||
* Phaser.Camera.ENABLE_FX is a const that controls if the Camera FX are available or not. It's `true` by default, but if you set it to `false` before boot then it won't create the Graphics object required to process the effects.
|
* Phaser.Camera.ENABLE_FX is a const that controls if the Camera FX are available or not. It's `true` by default, but if you set it to `false` before boot then it won't create the Graphics object required to process the effects.
|
||||||
|
* The Arcade Physics Body has two new properties: `left` and `top`. These are the same as `Body.x` and `Body.y` but allow you to pass the Body to geometry level functions such as Circle.contains.
|
||||||
### New Arcade Physics Features
|
|
||||||
|
|
||||||
* Body.setCircle allows you to define a Body as using a circle to collide with instead of a rectangle. You can set the radius of the collision circle and an offset.
|
|
||||||
* Body.render now renders both circle and rectangle body shapes to the Debug canvas.
|
|
||||||
* World.intersects has been updated to support both circle and rectangle body shapes, and supports quick-paths for circle vs. circle and rect vs. rect checks.
|
|
||||||
* World.circleBodyIntersects is a new method that checks for intersection between a Body that has been defined as a circle, and a normal rectangle based Body. This is used internally by World.intersects, but exposed for direct calls as well.
|
|
||||||
* Body has two new properties: `left` and `top`. These are the same as `Body.x` and `Body.y` but allow you to pass the Body to geometry level functions such as Circle.contains.
|
|
||||||
* World.separate has been optimized to cut down on the number of calls to `intersect` from 3 calls per Game Object collision check, to 2. So if you were colliding 50 sprites it will reduce the call count from 150 to 100 per frame. It also reduces the calls made to `seperateX` and `seperateY` by the same factor.
|
* World.separate has been optimized to cut down on the number of calls to `intersect` from 3 calls per Game Object collision check, to 2. So if you were colliding 50 sprites it will reduce the call count from 150 to 100 per frame. It also reduces the calls made to `seperateX` and `seperateY` by the same factor.
|
||||||
* Two immovable bodies would never set their overlap data, even if an overlap only check was being made. As this is useful data to have this has been changed. Two immovable bodies will still never separate from each other, but they _will_ have their `overlapX` and `overlapY` properties calculated now.
|
* Two immovable bodies would never set their overlap data, even if an overlap only check was being made. As this is useful data to have this has been changed. Two immovable bodies will still never separate from each other, but they _will_ have their `overlapX` and `overlapY` properties calculated now.
|
||||||
|
|
||||||
|
|
2
build/custom/p2.min.js
vendored
2
build/custom/p2.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
40
build/custom/phaser-arcade-physics.min.js
vendored
40
build/custom/phaser-arcade-physics.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
26
build/custom/phaser-minimum.min.js
vendored
26
build/custom/phaser-minimum.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
36
build/custom/phaser-no-physics.min.js
vendored
36
build/custom/phaser-no-physics.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
37
build/custom/phaser-split.min.js
vendored
37
build/custom/phaser-split.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,13 +1,13 @@
|
||||||
/**
|
/**
|
||||||
* @author Richard Davey <rich@photonstorm.com>
|
* @author Richard Davey <rich@photonstorm.com>
|
||||||
* @copyright 2015 Photon Storm Ltd.
|
* @copyright 2016 Photon Storm Ltd.
|
||||||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||||
*
|
*
|
||||||
* @overview
|
* @overview
|
||||||
*
|
*
|
||||||
* Phaser - http://phaser.io
|
* Phaser - http://phaser.io
|
||||||
*
|
*
|
||||||
* v2.4.6 "Baerlon" - Built: Thu Feb 18 2016 14:40:25
|
* v2.4.7 "Hinderstap" - Built: Thu Apr 14 2016 13:21:55
|
||||||
*
|
*
|
||||||
* By Richard Davey http://www.photonstorm.com @photonstorm
|
* By Richard Davey http://www.photonstorm.com @photonstorm
|
||||||
*
|
*
|
||||||
|
@ -1227,9 +1227,10 @@ PIXI.DisplayObjectContainer.prototype.displayObjectContainerUpdateTransform = PI
|
||||||
*/
|
*/
|
||||||
PIXI.DisplayObjectContainer.prototype.getBounds = function()
|
PIXI.DisplayObjectContainer.prototype.getBounds = function()
|
||||||
{
|
{
|
||||||
if(this.children.length === 0)return PIXI.EmptyRectangle;
|
if (this.children.length === 0)
|
||||||
|
{
|
||||||
// TODO the bounds have already been calculated this render session so return what we have
|
return PIXI.EmptyRectangle;
|
||||||
|
}
|
||||||
|
|
||||||
var minX = Infinity;
|
var minX = Infinity;
|
||||||
var minY = Infinity;
|
var minY = Infinity;
|
||||||
|
@ -1243,11 +1244,14 @@ PIXI.DisplayObjectContainer.prototype.getBounds = function()
|
||||||
|
|
||||||
var childVisible = false;
|
var childVisible = false;
|
||||||
|
|
||||||
for(var i=0,j=this.children.length; i<j; i++)
|
for (var i = 0; i < this.children.length; i++)
|
||||||
{
|
{
|
||||||
var child = this.children[i];
|
var child = this.children[i];
|
||||||
|
|
||||||
if(!child.visible)continue;
|
if (!child.visible)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
childVisible = true;
|
childVisible = true;
|
||||||
|
|
||||||
|
@ -1263,8 +1267,10 @@ PIXI.DisplayObjectContainer.prototype.getBounds = function()
|
||||||
maxY = maxY > childMaxY ? maxY : childMaxY;
|
maxY = maxY > childMaxY ? maxY : childMaxY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!childVisible)
|
if (!childVisible)
|
||||||
|
{
|
||||||
return PIXI.EmptyRectangle;
|
return PIXI.EmptyRectangle;
|
||||||
|
}
|
||||||
|
|
||||||
var bounds = this._bounds;
|
var bounds = this._bounds;
|
||||||
|
|
||||||
|
@ -1273,9 +1279,6 @@ PIXI.DisplayObjectContainer.prototype.getBounds = function()
|
||||||
bounds.width = maxX - minX;
|
bounds.width = maxX - minX;
|
||||||
bounds.height = maxY - minY;
|
bounds.height = maxY - minY;
|
||||||
|
|
||||||
// TODO: store a reference so that if this function gets called again in the render cycle we do not have to recalculate
|
|
||||||
//this._currentBounds = bounds;
|
|
||||||
|
|
||||||
return bounds;
|
return bounds;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1291,7 +1294,7 @@ PIXI.DisplayObjectContainer.prototype.getLocalBounds = function()
|
||||||
|
|
||||||
this.worldTransform = PIXI.identityMatrix;
|
this.worldTransform = PIXI.identityMatrix;
|
||||||
|
|
||||||
for(var i=0,j=this.children.length; i<j; i++)
|
for (var i = 0; i < this.children.length; i++)
|
||||||
{
|
{
|
||||||
this.children[i].updateTransform();
|
this.children[i].updateTransform();
|
||||||
}
|
}
|
||||||
|
@ -1299,6 +1302,11 @@ PIXI.DisplayObjectContainer.prototype.getLocalBounds = function()
|
||||||
var bounds = this.getBounds();
|
var bounds = this.getBounds();
|
||||||
|
|
||||||
this.worldTransform = matrixCache;
|
this.worldTransform = matrixCache;
|
||||||
|
|
||||||
|
for (i = 0; i < this.children.length; i++)
|
||||||
|
{
|
||||||
|
this.children[i].updateTransform();
|
||||||
|
}
|
||||||
|
|
||||||
return bounds;
|
return bounds;
|
||||||
};
|
};
|
||||||
|
@ -1602,6 +1610,7 @@ PIXI.Sprite.prototype.setTexture = function(texture, destroyBase)
|
||||||
this.texture.baseTexture.skipRender = false;
|
this.texture.baseTexture.skipRender = false;
|
||||||
this.texture = texture;
|
this.texture = texture;
|
||||||
this.texture.valid = true;
|
this.texture.valid = true;
|
||||||
|
this.cachedTint = -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1619,7 +1628,15 @@ PIXI.Sprite.prototype.onTextureUpdate = function()
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the bounds of the Sprite as a rectangle. The bounds calculation takes the worldTransform into account.
|
* Returns the bounds of the Sprite as a rectangle.
|
||||||
|
* The bounds calculation takes the worldTransform into account.
|
||||||
|
*
|
||||||
|
* It is important to note that the transform is not updated when you call this method.
|
||||||
|
* So if this Sprite is the child of a Display Object which has had its transform
|
||||||
|
* updated since the last render pass, those changes will not yet have been applied
|
||||||
|
* to this Sprites worldTransform. If you need to ensure that all parent transforms
|
||||||
|
* are factored into this getBounds operation then you should call `updateTransform`
|
||||||
|
* on the root most object in this Sprites display list first.
|
||||||
*
|
*
|
||||||
* @method getBounds
|
* @method getBounds
|
||||||
* @param matrix {Matrix} the transformation matrix of the sprite
|
* @param matrix {Matrix} the transformation matrix of the sprite
|
||||||
|
@ -2212,7 +2229,7 @@ PIXI.isPowerOfTwo = function(width, height)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Richard Davey <rich@photonstorm.com>
|
* @author Richard Davey <rich@photonstorm.com>
|
||||||
* @copyright 2015 Photon Storm Ltd.
|
* @copyright 2016 Photon Storm Ltd.
|
||||||
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -6581,10 +6598,6 @@ PIXI.CanvasRenderer = function (game) {
|
||||||
*/
|
*/
|
||||||
this.refresh = true;
|
this.refresh = true;
|
||||||
|
|
||||||
// This is already done in the Game.setUpRenderer method.
|
|
||||||
// this.view.width = this.width * this.resolution;
|
|
||||||
// this.view.height = this.height * this.resolution;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal var.
|
* Internal var.
|
||||||
*
|
*
|
||||||
|
@ -6673,8 +6686,8 @@ PIXI.CanvasRenderer.prototype.render = function (stage) {
|
||||||
* @method destroy
|
* @method destroy
|
||||||
* @param [removeView=true] {boolean} Removes the Canvas element from the DOM.
|
* @param [removeView=true] {boolean} Removes the Canvas element from the DOM.
|
||||||
*/
|
*/
|
||||||
PIXI.CanvasRenderer.prototype.destroy = function(removeView)
|
PIXI.CanvasRenderer.prototype.destroy = function (removeView) {
|
||||||
{
|
|
||||||
if (removeView === undefined) { removeView = true; }
|
if (removeView === undefined) { removeView = true; }
|
||||||
|
|
||||||
if (removeView && this.view.parent)
|
if (removeView && this.view.parent)
|
||||||
|
@ -6696,8 +6709,8 @@ PIXI.CanvasRenderer.prototype.destroy = function(removeView)
|
||||||
* @param width {Number} the new width of the canvas view
|
* @param width {Number} the new width of the canvas view
|
||||||
* @param height {Number} the new height of the canvas view
|
* @param height {Number} the new height of the canvas view
|
||||||
*/
|
*/
|
||||||
PIXI.CanvasRenderer.prototype.resize = function(width, height)
|
PIXI.CanvasRenderer.prototype.resize = function (width, height) {
|
||||||
{
|
|
||||||
this.width = width * this.resolution;
|
this.width = width * this.resolution;
|
||||||
this.height = height * this.resolution;
|
this.height = height * this.resolution;
|
||||||
|
|
||||||
|
@ -6709,6 +6722,12 @@ PIXI.CanvasRenderer.prototype.resize = function(width, height)
|
||||||
this.view.style.width = this.width / this.resolution + "px";
|
this.view.style.width = this.width / this.resolution + "px";
|
||||||
this.view.style.height = this.height / this.resolution + "px";
|
this.view.style.height = this.height / this.resolution + "px";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.renderSession.smoothProperty)
|
||||||
|
{
|
||||||
|
this.context[this.renderSession.smoothProperty] = (this.renderSession.scaleMode === PIXI.scaleModes.LINEAR);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -8871,10 +8890,8 @@ PIXI.TilingSprite.prototype.generateTilingTexture = function(forcePowerOfTwo, re
|
||||||
var texture = this.texture;
|
var texture = this.texture;
|
||||||
var frame = texture.frame;
|
var frame = texture.frame;
|
||||||
|
|
||||||
console.log('generateTilingTexture', texture, frame);
|
var targetWidth = this._frame.sourceSizeW || this._frame.width;
|
||||||
|
var targetHeight = this._frame.sourceSizeH || this._frame.height;
|
||||||
var targetWidth = this._frame.sourceSizeW;
|
|
||||||
var targetHeight = this._frame.sourceSizeH;
|
|
||||||
|
|
||||||
var dx = 0;
|
var dx = 0;
|
||||||
var dy = 0;
|
var dy = 0;
|
||||||
|
|
File diff suppressed because one or more lines are too long
8
build/custom/pixi.min.js
vendored
8
build/custom/pixi.min.js
vendored
File diff suppressed because one or more lines are too long
2239
build/phaser.js
2239
build/phaser.js
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
42
build/phaser.min.js
vendored
42
build/phaser.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -15,7 +15,7 @@ var Phaser = Phaser || {
|
||||||
* @constant
|
* @constant
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
VERSION: '2.4.7-dev',
|
VERSION: '2.4.7 RC1',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An array of Phaser game instances.
|
* An array of Phaser game instances.
|
||||||
|
|
Loading…
Reference in a new issue