Merge pull request #2 from photonstorm/dev

Dev
This commit is contained in:
standardgaussian 2015-07-11 15:51:47 -04:00
commit 35f55c031a
19 changed files with 11453 additions and 7345 deletions

View file

@ -16,7 +16,7 @@ Thousands of developers worldwide use it. From indies and multi-national digital
* **Read:** Subscribe to the [Newsletter](https://confirmsubscription.com/h/r/369DE48E3E86AF1E) and grab our [Phaser Books](http://phaser.io/shop)
* **Chat:** [#phaserio IRC channel](http://www.html5gamedevs.com/topic/4470-official-phaserio-irc-channel-phaserio-on-freenode/) on freenode
* **Extend:** With [Phaser Plugins](https://github.com/photonstorm/phaser-plugins)
* **Be awesome:** Support our work via [Gratipay](https://gratipay.com/photonstorm/)
* **Be awesome:** Support our work by buying our [books](http://phaser.io/shop/books) and [plugins](http://phaser.io/shop/plugins)
![div](http://www.phaser.io/images/github/div.png)
@ -39,25 +39,11 @@ Thousands of developers worldwide use it. From indies and multi-national digital
<div align="center"><img src="http://phaser.io/images/github/news.jpg"></div>
> 26th March 2015
> 15th July 2015
Phaser 2.3.0 marks the second release in 2015 and easily one of our most significant for a while. In terms of API changes they're actually quite minimal, but under the hood we've taken Phaser for a serious workout.
To be written.
We've traditionally had something of a 'kitchen sink' issue with Phaser. As we thought of great new features to give you we just added them in. And like too much of a good thing they contributed to an ever growing file size.
So two of the biggest changes 2.3.0 has is an internal shift to using Game Object components, and allowing you to exclude features in your own custom builds. The new build system lets you selectively exclude features from being bundled in: for example if your game doesn't need Gamepad or Keyboard support you can now tell Phaser to skip those parts entirely.
[This tutorial](http://phaser.io/tutorials/creating-custom-phaser-builds) explains the process in detail. But the end result is that thanks to these changes we've both managed to remove thousands of lines of code and let you decide what Phaser contains. The minimum build size is now just 83KB minified and gzipped and that's still including both the WebGL and Canvas renderers.
Even though we've been cutting down on size we still managed to pack a whole load of great new features in. For example the new spacial sorting added to Arcade Physics allows for incredible speed increases when dealing with densely populated game worlds. The Loader has received a complete overhaul - now offering full parallel asset loading, sync points and more! The Tilemap system was upgraded to support new Tiled 0.11 editor features. Audio has been also been enhanced, with better marker and loop handling. See the Change Log for all the details.
Your games will run faster, have a smaller footprint, and load faster than ever.
But it's not just Phaser that has been updated - we also finally released the [new Phaser web site](http://phaser.io)! For the past few years it was a huge "wall of text", with hundreds of links filling up the single page site. Now it's all changed! with a much more attractive layout and structure. We've got a healthy and constantly updating [news section](http://phaser.io/news), the [examples](http://phaser.io/examples) have a great new visual showcase and there's even a [Sandbox](http://phaser.io/sandbox) to play in.
It was a lot of hard work but we're super-happy with the result - and judging by our page hits, which are going off the charts, you are too :) We'll be sure to keep enhancing it over the coming months, especially as Phaser 3 development ramps up.
That's all for now. I hope you enjoy Phaser 2.3.0, the new site, the new features and the New Year. Happy coding everyone! See you on the forums.
That's all for now. I hope you enjoy Phaser 2.4.0. Happy coding everyone! See you on the forums.
Cheers,
@ -91,15 +77,15 @@ Install via [npm](https://www.npmjs.com)
[jsDelivr](http://www.jsdelivr.com/#!phaser) is a "super-fast CDN for developers". Include the following in your html:
`<script src="//cdn.jsdelivr.net/phaser/2.3.0/phaser.js"></script>`
`<script src="//cdn.jsdelivr.net/phaser/2.4.0/phaser.js"></script>`
or the minified version:
`<script src="//cdn.jsdelivr.net/phaser/2.3.0/phaser.min.js"></script>`
`<script src="//cdn.jsdelivr.net/phaser/2.4.0/phaser.min.js"></script>`
[cdnjs.com](https://cdnjs.com/libraries/phaser) also offers a free CDN service. They have all versions of Phaser and even the custom builds:
`<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.3.0/phaser.js"></script>`
`<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.4.0/phaser.js"></script>`
### Phaser Sandbox
@ -231,7 +217,7 @@ All Phaser development is now taking place on the Phaser 3 project. The Phaser 2
<a name="phaser3"></a>
## Phaser 3
We're now several months in to development of Phaser 3. We've been working hard on creating a brand new and extremely powerful renderer. Progress reports are posted to the web site and [Phaser 3 repo](https://github.com/photonstorm/phaser3).
We're now a good way in to development of Phaser 3. We've been working hard on creating a brand new and extremely powerful renderer. Progress reports are posted to the [web site](http://phaser.io/labs) and [Phaser 3 repo](https://github.com/photonstorm/phaser3).
There is still plenty of time to add your suggestions and feedback in [this forum thread](http://www.html5gamedevs.com/topic/7949-the-phaser-3-wishlist-thread/).
@ -331,6 +317,7 @@ Version 2.4 - "Katar" - in dev
* All Game Objects have a new boolean property called `pendingDestroy`. If you set this to `true` then the object will automatically destroy itself in the *next* logic update, rather than immediately. This is useful for cases when you wish to destroy an object from within one of its own callbacks, such as with buttons or other input events (thanks @alamboley #1748)
* BitmapData.generateTexture will take a snapshot of the BitmapDatas canvas at that moment in time and convert it into an Image, which is then stored in the Phaser image Cache based on the key given. You can then use the new texture for any future sprites or texture based objects.
* All Signals now have the ability to carry extra custom arguments with them, which are passed on to the callback you define after any internal arguments. For example a Phaser.Key has an onDown signal. When dispatched onDown sends a reference to the Key as the first and only argument. But you can now set the callback like this: `fireKey.onDown.add(shoot, this, 0, 'lazer', 64)`. So when the onDown signal is dispatched internally the callback (`shoot` in this case) will receive 3 arguments: the Key reference that is raised internally and the string 'lazer' and value 64, which were the custom arguments provided when setting-up the callback.
* Group.moveAll allows you to move all of the children of a Group into another Group.
### Updates
@ -382,6 +369,7 @@ Version 2.4 - "Katar" - in dev
* RandomDataGenerator.weightedPick has been tweaked slightly to allow for a more even distribution of weights. It still favors the earlier array elements, but will accurately include 'distance' elements as well (thanks @gingerbeardman #1751)
* BitmapData.clear has 4 new optional parameters: x, y, width and height, that define the area to be cleared. If left undefined it works exactly the same as before and clears the entire canvas.
* Added Phaser.Keyboard.COMMA and Phaser.Keyboard.PERIOD to the consts list.
* Canvas.setSmoothingEnabled only applies the value of the property exists, which avoids the Chrome webkit prefix deprecation warnings.
### Bug Fixes
@ -434,6 +422,7 @@ Version 2.4 - "Katar" - in dev
* Rope.segments used the wrong vertices property, causing a runtime error.
* Debug.ropeSegments didn't take the scale of the Rope object into consideration, causing incorrect debug rendering.
* If a Sound was muted, or had its volume changed while it was still decoding (i.e. before it started playback) then the mute and/or volume were ignored and the sound would play anyway (thanks @brianbunch #1872)
* Group.addMultiple if given a Group.children array as the first parameter would fail as the original group length was decreased out of line with the children being added. Group.addMultiple now checks if the children argument is a Phaser.Group instance, and if so it uses Group.moveAll instead on it (thanks @AnderbergE #1898)
### Deprecated

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

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

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

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

48
build/phaser.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -9,6 +9,7 @@
* TODO: Gradient generator
* TODO: Look at sfxr for audio gen
* TODO: Dither support
* TODO: Sprite Sheet generator
*
* @class Phaser.Create
* @constructor

View file

@ -362,20 +362,25 @@ Phaser.Group.prototype.removeFromHash = function (child) {
};
/**
* Adds an array of existing display objects to this group.
* Adds an array of existing Display Objects to this Group.
*
* The children are automatically added to the top of the group, so render on-top of everything else within the group.
* The Display Objects are automatically added to the top of this Group, and will render on-top of everything already in this Group.
*
* TODO: Add ability to pass the children as parameters rather than having to be an array.
* As well as an array you can also pass another Group as the first argument. In this case all of the children from that
* Group will be removed from it and added into this Group.
*
* @method Phaser.Group#addMultiple
* @param {DisplayObject[]} children - An array of display objects to add as children.
* @param {DisplayObject[]|Phaser.Group} children - An array of display objects or a Phaser.Group. If a Group is given then *all* children will be moved from it.
* @param {boolean} [silent=false] - If true the children will not dispatch the `onAddedToGroup` event.
* @return {DisplayObject[]} The array of children that were added to the group.
* @return {DisplayObject[]|Phaser.Group} The array of children or Group of children that were added to this Group.
*/
Phaser.Group.prototype.addMultiple = function (children, silent) {
if (Array.isArray(children))
if (children instanceof Phaser.Group)
{
children.moveAll(this, silent);
}
else if (Array.isArray(children))
{
for (var i = 0; i < children.length; i++)
{
@ -504,7 +509,7 @@ Phaser.Group.prototype.create = function (x, y, key, frame, exists) {
* Useful if you need to quickly generate a pool of identical sprites, such as bullets.
*
* By default the sprites will be set to not exist and will be positioned at 0, 0 (relative to the group.x/y).
* Use {@link #classType} to change the type of object creaded.
* Use {@link #classType} to change the type of object created.
*
* @method Phaser.Group#createMultiple
* @param {integer} quantity - The number of Sprites to create.
@ -524,7 +529,7 @@ Phaser.Group.prototype.createMultiple = function (quantity, key, frame, exists)
};
/**
* Internal method that re-applies all of the childrens Z values.
* Internal method that re-applies all of the children's Z values.
*
* This must be called whenever children ordering is altered so that their `z` indices are correctly updated.
*
@ -1929,6 +1934,35 @@ Phaser.Group.prototype.remove = function (child, destroy, silent) {
};
/**
* Moves all children from this Group to the Group given.
*
* @method Phaser.Group#moveAll
* @param {Phaser.Group} group - The new Group to which the children will be moved to.
* @param {boolean} [silent=false] - If true the children will not dispatch the `onAddedToGroup` event for the new Group.
* @return {Phaser.Group} The Group to which all the children were moved.
*/
Phaser.Group.prototype.moveAll = function (group, silent) {
if (typeof silent === 'undefined') { silent = false; }
if (this.children.length > 0 && group instanceof Phaser.Group)
{
do
{
group.add(this.children[0], silent);
}
while (this.children.length > 0);
this.hash = [];
this.cursor = null;
}
return group;
};
/**
* Removes all children from this group, but does not remove the group from its parent.
*

View file

@ -1209,18 +1209,6 @@ Phaser.ScaleManager.prototype = {
var changed = previousOrientation !== this.screenOrientation;
var correctnessChanged = previouslyIncorrect !== this.incorrectOrientation;
if (changed)
{
if (this.isLandscape)
{
this.enterLandscape.dispatch(this.orientation, true, false);
}
else
{
this.enterPortrait.dispatch(this.orientation, false, true);
}
}
if (correctnessChanged)
{
if (this.incorrectOrientation)

View file

@ -201,11 +201,18 @@ Phaser.Canvas = {
*/
setSmoothingEnabled: function (context, value) {
context['imageSmoothingEnabled'] = value;
context['mozImageSmoothingEnabled'] = value;
context['oImageSmoothingEnabled'] = value;
context['webkitImageSmoothingEnabled'] = value;
context['msImageSmoothingEnabled'] = value;
var vendor = [ 'i', 'mozI', 'oI', 'webkitI', 'msI' ];
for (var prefix in vendor)
{
var s = vendor[prefix] + 'mageSmoothingEnabled';
if (s in context)
{
context[s] = value;
return context;
}
}
return context;

View file

@ -1,5 +1,6 @@
[
"src/core/Camera.js",
"src/core/Create.js",
"src/core/State.js",
"src/core/StateManager.js",
"src/core/Signal.js",

View file

@ -1543,6 +1543,7 @@ declare module Phaser {
getTop(): any;
hasProperty(child: any, key: string[]): boolean;
iterate(key: string, value: any, returnType: number, callback?: Function, callbackContext?: any, ...args: any[]): any;
moveAll(group: Phaser.Group, silent?: boolean): Phaser.Group;
moveDown(child: any): any;
moveUp(child: any): any;
multiplyAll(property: string, amount: number, checkAlive: boolean, checkVisible: boolean): void;