Skip to content

Commit 4b22f48

Browse files
committed
2.4.2 release.
1 parent 9620661 commit 4b22f48

File tree

392 files changed

+1292
-942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

392 files changed

+1292
-942
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Change Log
22

3+
## Version 2.4.2 - "Altara" - 29th July 2015
4+
5+
### Updates
6+
7+
* TypeScript definitions fixes and updates (thanks @clark-stevenson @shivinsky)
8+
* JSDoc typo fixes (thanks @DrkSephy)
9+
* TilemapLayer - Fixed unmatched `context.save` and `context.restore` calls (thanks @MortimerGoro #1934)
10+
* Cache.getFrame has a new `cache` parameter (that defaults to the Image cache, but can be changed to any other)
11+
* Cache.getFrameCount has a new `cache` parameter (that defaults to the Image cache, but can be changed to any other)
12+
* Cache.getFrameData has a new `cache` parameter (that defaults to the Image cache, but can be changed to any other)
13+
* Cache.hasFrameData has a new `cache` parameter (that defaults to the Image cache, but can be changed to any other)
14+
* Cache.getFrameByIndex has a new `cache` parameter (that defaults to the Image cache, but can be changed to any other)
15+
* Cache.getFrameByName has a new `cache` parameter (that defaults to the Image cache, but can be changed to any other)
16+
* Device.canPlayVideo now checks for `ogv` as a valid file extension for OGG video files (thanks @JB-Tellez #1928)
17+
* Phaser.Sound will now automatically check the Cache to see if the audio file it is using is still there or not. If not then it will automatically called `Sound.destroy` on itself. If you do not desire this result then you should ensure that you undertake all house-keeping yourself, and properly destroy Sound objects _before_ calling `Cache.removeSound` (#1946)
18+
19+
### Bug Fixes
20+
21+
* DeviceButton would try to set `altKey`, `shiftKey` and `ctrlKey` even for Joypads (thanks @zatch #1939)
22+
* Pointer.move would accidentally reset the `isDown` status of the Pointer on touch devices, which broke things like Sprite input events when built to native apps or run locally (#1932 #1943)
23+
* Pointer.onDown (and input enabled items like Buttons) would fail on FireFox / Linux and CocoonJS (#1944 #1945)
24+
325
## Version 2.4.1 - "Ionin Spring" - 24th July 2015
426

527
This is a small point release that updates the Creature runtimes and fixes a couple of small cache issues.

Gruntfile.js

Lines changed: 150 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ module.exports = function (grunt) {
1414
docs_dir: 'docs',
1515
sourcemap: false,
1616
filename: 'phaser',
17+
pixiFilename: 'pixi.js',
18+
p2Filename: 'p2.js',
19+
creatureFilename: 'creature.js',
1720
filelist: [],
1821
banner: require('fs').readFileSync(__dirname + '/tasks/banner.txt', 'utf8')
1922
}
@@ -85,9 +88,13 @@ module.exports = function (grunt) {
8588
}
8689
}
8790

88-
grunt.log.writeln("\nFor example: --exclude p2,tilemap,retrofont");
89-
grunt.log.writeln("Optional flags: --filename yourfilename and --sourcemap true");
90-
grunt.log.writeln("Note that some modules have dependencies on others.\n");
91+
grunt.log.writeln("\nFor example: --exclude p2,tilemaps,retrofont\n");
92+
grunt.log.writeln("Optional flags:\n");
93+
grunt.log.writeln("--filename yourfilename (builds to your own custom file name)");
94+
grunt.log.writeln("--sourcemap true (creates a source map)");
95+
grunt.log.writeln("--split true (splits Phaser, PIXI, p2 and Creature into separate files)");
96+
grunt.log.writeln("--uglify true (runs Uglify on the output files)");
97+
grunt.log.writeln("\nNote that some modules have dependencies on others.\n");
9198

9299
grunt.fail.fatal("No build options were specified.");
93100
}
@@ -96,8 +103,11 @@ module.exports = function (grunt) {
96103
// Defaults
97104
grunt.config.set('sourcemap', false);
98105
grunt.config.set('filename', 'phaser');
106+
grunt.config.set('split', false);
99107
grunt.config.set('target_dir', '<%= release_dir %>');
100108

109+
var split = false;
110+
101111
// Overrides
102112
if (grunt.option('filename'))
103113
{
@@ -109,6 +119,12 @@ module.exports = function (grunt) {
109119
grunt.config.set('sourcemap', grunt.option('sourcemap'));
110120
}
111121

122+
if (grunt.option('split'))
123+
{
124+
grunt.config.set('split', grunt.option('split'));
125+
split = grunt.option('split');
126+
}
127+
112128
grunt.log.writeln("Excluding modules:\n");
113129

114130
var excludedKeys = [];
@@ -151,60 +167,140 @@ module.exports = function (grunt) {
151167
}
152168
}
153169

154-
// Ok we know the excludes array is fine, let's get this show started
155-
156-
grunt.log.writeln("\nPackaging Globals ...\n");
170+
/////////////////////////////////////////////////////////////////////////
171+
// Ok we know the excludes array is fine, let's get this show started //
172+
/////////////////////////////////////////////////////////////////////////
157173

158174
var filelist = [];
175+
var pixiFilelist = [];
159176

160177
// Clean the working folder
161178
var tasks = [ 'clean:build' ];
162179

163-
// Prepare the globals first, the libs that live outside of Phaser
180+
if (split)
181+
{
164182

165-
// 1) Creature
183+
////////////////////////////////////////
184+
// Split build (for Browserify, etc) //
185+
////////////////////////////////////////
166186

167-
if (!excludedKeys['creature'])
168-
{
169-
grunt.log.writeln("-> Creature");
170-
tasks.push('concat:creatureGlobal');
171-
filelist.push('<%= modules_dir %>/creature-global.js');
172-
}
187+
grunt.log.writeln("\nSplitting Globals ...\n");
173188

174-
// 2) P2
189+
// 1) Creature
175190

176-
if (!excludedKeys['p2'])
177-
{
178-
grunt.log.writeln("-> P2.js");
179-
tasks.push('concat:p2Global');
180-
filelist.push('<%= modules_dir %>/p2-global.js');
181-
}
191+
if (!excludedKeys['creature'])
192+
{
193+
grunt.log.writeln("-> Creature");
194+
tasks.push('concat:creatureGlobalSplit');
182195

183-
// 3) PIXI
196+
if (grunt.option('uglify'))
197+
{
198+
tasks.push('uglify:creature');
199+
}
200+
}
184201

185-
grunt.log.writeln("-> PIXI");
186-
tasks.push('concat:pixiIntro');
187-
filelist.push('<%= modules_dir %>/pixi-intro.js');
202+
// 2) P2
188203

189-
// Optional Rope
190-
if (!excludedKeys['rope'])
191-
{
192-
grunt.log.writeln("-> PIXI.Rope");
193-
tasks.push('concat:pixiRope');
194-
filelist.push('<%= modules_dir %>/pixi-rope.js');
195-
}
204+
if (!excludedKeys['p2'])
205+
{
206+
grunt.log.writeln("-> P2.js");
207+
tasks.push('concat:p2GlobalSplit');
196208

197-
// Optional Tilesprite
198-
if (!excludedKeys['tilesprite'])
199-
{
200-
grunt.log.writeln("-> PIXI.TileSprite");
201-
tasks.push('concat:pixiTileSprite');
202-
filelist.push('<%= modules_dir %>/pixi-tilesprite.js');
209+
if (grunt.option('uglify'))
210+
{
211+
tasks.push('uglify:p2');
212+
}
213+
}
214+
215+
// 3) PIXI
216+
217+
grunt.log.writeln("-> PIXI");
218+
tasks.push('concat:pixiIntro');
219+
pixiFilelist.push('<%= modules_dir %>/pixi-intro.js');
220+
221+
// Optional Rope
222+
if (!excludedKeys['rope'])
223+
{
224+
grunt.log.writeln("-> PIXI.Rope");
225+
tasks.push('concat:pixiRope');
226+
pixiFilelist.push('<%= modules_dir %>/pixi-rope.js');
227+
}
228+
229+
// Optional Tilesprite
230+
if (!excludedKeys['tilesprite'])
231+
{
232+
grunt.log.writeln("-> PIXI.TileSprite");
233+
tasks.push('concat:pixiTileSprite');
234+
pixiFilelist.push('<%= modules_dir %>/pixi-tilesprite.js');
235+
}
236+
237+
// PIXI Outro
238+
tasks.push('concat:pixiOutro');
239+
pixiFilelist.push('<%= modules_dir %>/pixi-outro.js');
240+
241+
grunt.config.set('pixiFilelist', pixiFilelist);
242+
243+
tasks.push('concat:pixi');
244+
245+
if (grunt.option('uglify'))
246+
{
247+
tasks.push('uglify:pixi');
248+
}
203249
}
250+
else
251+
{
252+
///////////////////
253+
// Single build //
254+
///////////////////
255+
256+
grunt.log.writeln("\nPackaging Globals ...\n");
257+
258+
// Prepare the globals first, the libs that live outside of Phaser
259+
260+
// 1) Creature
261+
262+
if (!excludedKeys['creature'])
263+
{
264+
grunt.log.writeln("-> Creature");
265+
tasks.push('concat:creatureGlobal');
266+
filelist.push('<%= modules_dir %>/creature-global.js');
267+
}
204268

205-
// PIXI Outro
206-
tasks.push('concat:pixiOutro');
207-
filelist.push('<%= modules_dir %>/pixi-outro.js');
269+
// 2) P2
270+
271+
if (!excludedKeys['p2'])
272+
{
273+
grunt.log.writeln("-> P2.js");
274+
tasks.push('concat:p2Global');
275+
filelist.push('<%= modules_dir %>/p2-global.js');
276+
}
277+
278+
// 3) PIXI
279+
280+
grunt.log.writeln("-> PIXI");
281+
tasks.push('concat:pixiIntro');
282+
filelist.push('<%= modules_dir %>/pixi-intro.js');
283+
284+
// Optional Rope
285+
if (!excludedKeys['rope'])
286+
{
287+
grunt.log.writeln("-> PIXI.Rope");
288+
tasks.push('concat:pixiRope');
289+
filelist.push('<%= modules_dir %>/pixi-rope.js');
290+
}
291+
292+
// Optional Tilesprite
293+
if (!excludedKeys['tilesprite'])
294+
{
295+
grunt.log.writeln("-> PIXI.TileSprite");
296+
tasks.push('concat:pixiTileSprite');
297+
filelist.push('<%= modules_dir %>/pixi-tilesprite.js');
298+
}
299+
300+
// PIXI Outro
301+
tasks.push('concat:pixiOutro');
302+
filelist.push('<%= modules_dir %>/pixi-outro.js');
303+
}
208304

209305
// And now for Phaser
210306

@@ -320,6 +416,19 @@ module.exports = function (grunt) {
320416

321417
});
322418

419+
grunt.registerTask('split', 'Compile Phaser to dist folder and splits the globals into single files', function() {
420+
421+
grunt.option('exclude', 'ninja,creature');
422+
grunt.option('filename', 'phaser');
423+
grunt.option('sourcemap', true);
424+
grunt.option('copy', false);
425+
grunt.option('uglify', true);
426+
grunt.option('split', true);
427+
428+
grunt.task.run('custom');
429+
430+
});
431+
323432
grunt.registerTask('test', 'Phaser Test Build (all libs)', function() {
324433

325434
grunt.option('exclude', 'ninja,creature');

README.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ Thousands of developers worldwide use it. From indies and multi-national digital
1616
* **Read:** Subscribe to the [Newsletter](https://confirmsubscription.com/h/r/369DE48E3E86AF1E) and grab our [Phaser Books](http://phaser.io/shop)
1717
* **Chat:** [#phaserio IRC channel](http://www.html5gamedevs.com/topic/4470-official-phaserio-irc-channel-phaserio-on-freenode/) on freenode
1818
* **Extend:** With [Phaser Plugins](https://github.com/photonstorm/phaser-plugins)
19-
* **Be awesome:** Support our work by buying our [books](http://phaser.io/shop/books) and [plugins](http://phaser.io/shop/plugins)
19+
* **Be awesome:** Support the future of Phaser on [Patreon](https://www.patreon.com/photonstorm) or by buying our [books](http://phaser.io/shop/books) and [plugins](http://phaser.io/shop/plugins)
2020

2121
![div](http://www.phaser.io/images/github/div.png)
2222

2323
## Index
2424

2525
- [What's New?](#whats-new)
26+
- [Support Phaser](#patreon)
2627
- [Download Phaser](#download)
2728
- [Getting Started](#getting-started)
2829
- [Using Phaser](#using-phaser)
@@ -39,21 +40,17 @@ Thousands of developers worldwide use it. From indies and multi-national digital
3940

4041
<div align="center"><img src="http://phaser.io/images/github/news.jpg"></div>
4142

42-
> 24th July 2015
43+
> 29th July 2015
4344
4445
Phaser 2.4 is another huge update. We had to bump the version number from 2.3 directly to 2.4 because of some API adjustments, all of which are fully detailed in the [Change Log](#change-log). While it's true we could have released it over a few smaller point releases, that just isn't how the cookie crumbled this time. _Be sure to pay attention to the previous deprecated API calls that have been removed in 2.4._
4546

4647
So although you had to wait for it a couple months more than usual, Phaser 2.4 is quite simply an **epic release** - there is no two ways about it! Brand new video component? Check. Support for fully boned Creature animations? Check. Brand new Cache and Loader updates? Check. Dynamic sprite and gradient generator? Check. Literally hundreds of updates, enhancements and fixes across the entire codebase? Yup, those too! The Change Log seems to scroll on forever, yet the overall package size continues to come down as we optimise and streamline our code too (this release actually builds smaller than 2.3 did, just 80KB min + gz)
4748

48-
A few people on the forum have asked how Phaser is funded: Phaser is a fully open-source project and as such we have no _direct_ income from it at all. All development is funded by the client work that [my company](http://www.photonstorm.com) takes on. And of course the contributions from the incredible community (who also volunteer their skills for free).
49-
50-
Sometimes this work directly impacts on Phaser. For example we recently built [5 games](http://www.insideouthq.com) for the new Pixar film Inside Out. Being Pixar they of course had high video requirements, so we literally coded from scratch the way videos were handled and added in video stream support in the process. Very often though our work simply uses Phaser but doesn't enhance it. Which is why if you buy any of the books or plugins we have on sale it really does make a difference! It buys us time to work on Phaser un-interrupted, which in turn benefits everyone. Some have asked if we could add a 'donate' button to the site, but instead I'd rather you get value from your money - so if we release a new plugin, book or magazine you like the look of, please do consider it a donation towards the continued work we all put in.
51-
52-
Money stuff aside please enjoy this brand new release. We'll carry on supporting Phaser 2 for the rest of 2015 _at least_, while development of the Phaser 3 renderer proceeds at a rapid pace too.
53-
5449
Make sure you check out the Phaser web site. We are going to be adding in stacks of new examples and features in the coming weeks.
5550

56-
But that's all for now. I hope you enjoy Phaser 2.4. Happy coding everyone! See you on the forums.
51+
Also we'd be extremely grateful if you could get involved with our [Patreon campaign](https://www.patreon.com/photonstorm). We've got some really ambitious plans for how we'd like to see Phaser evolve in the future. Hopefully together we can reach that goal faster.
52+
53+
But that's all for now. I hope you enjoy Phaser 2.4.
5754

5855
Happy coding everyone! See you on the forums.
5956

@@ -65,6 +62,13 @@ Rich - [@photonstorm](https://twitter.com/photonstorm)
6562

6663
![div](http://www.phaser.io/images/github/div.png)
6764

65+
<a name="patreon"></a>
66+
## Support Phaser on Patreon
67+
68+
![patreon](http://www.phaser.io/images/patreon.png)
69+
70+
Please help support the future development of Phaser through our [Patreon campaign](https://www.patreon.com/photonstorm). We've some exciting plans and there's so much we'd like to do - let's see if we can all work together to make this possible.
71+
6872
<a name="download"></a>
6973
## Download Phaser
7074

@@ -242,9 +246,7 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
242246
<a name="change-log"></a>
243247
## Change Log
244248

245-
## Version 2.4.2 - "Altara" - in dev
246-
247-
### New Features
249+
## Version 2.4.2 - "Altara" - 29th July 2015
248250

249251
### Updates
250252

@@ -260,15 +262,11 @@ If you are an exceptional JavaScript developer and would like to join the Phaser
260262
* Device.canPlayVideo now checks for `ogv` as a valid file extension for OGG video files (thanks @JB-Tellez #1928)
261263
* Phaser.Sound will now automatically check the Cache to see if the audio file it is using is still there or not. If not then it will automatically called `Sound.destroy` on itself. If you do not desire this result then you should ensure that you undertake all house-keeping yourself, and properly destroy Sound objects _before_ calling `Cache.removeSound` (#1946)
262264

263-
264265
### Bug Fixes
265266

266267
* DeviceButton would try to set `altKey`, `shiftKey` and `ctrlKey` even for Joypads (thanks @zatch #1939)
267268
* Pointer.move would accidentally reset the `isDown` status of the Pointer on touch devices, which broke things like Sprite input events when built to native apps or run locally (#1932 #1943)
268-
269-
270-
271-
269+
* Pointer.onDown (and input enabled items like Buttons) would fail on FireFox / Linux and CocoonJS (#1944 #1945)
272270

273271
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).
274272

build/custom/phaser-arcade-physics.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser - http://phaser.io
99
*
10-
* v2.4.2 "Altara" - Built: Tue Jul 28 2015 14:17:06
10+
* v2.4.2 "Altara" - Built: Wed Jul 29 2015 14:59:28
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm
1313
*
@@ -77,7 +77,7 @@ PIXI.CANVAS_RENDERER = 1;
7777
*/
7878
PIXI.VERSION = "v2.2.8";
7979

80-
// used to create uids for various pixi objects..
80+
// used to create uids for various pixi objects.
8181
PIXI._UID = 0;
8282

8383
if (typeof(Float32Array) != 'undefined')
@@ -10383,7 +10383,7 @@ var Phaser = Phaser || {
1038310383
* @constant
1038410384
* @type {string}
1038510385
*/
10386-
VERSION: '2.4.2-dev',
10386+
VERSION: '2.4.2',
1038710387

1038810388
/**
1038910389
* An array of Phaser game instances.
@@ -43876,6 +43876,8 @@ Phaser.Text.fontPropertiesContext = Phaser.Text.fontPropertiesCanvas.getContext(
4387643876
* For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of
4387743877
* converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson
4387843878
*
43879+
* If you were using an older version of Phaser (< 2.4) and using the DOMish parser hack, please remove this. It isn't required any longer.
43880+
*
4387943881
* @class Phaser.BitmapText
4388043882
* @constructor
4388143883
* @extends PIXI.DisplayObjectContainer

build/custom/phaser-arcade-physics.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-arcade-physics.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)