Skip to content

Commit 49ac475

Browse files
authored
Merge pull request #204 from photonstorm/release-v2.7.8
Phaser CE Version 2.7.8
2 parents 7412d8b + 8829b2b commit 49ac475

File tree

432 files changed

+9838
-8105
lines changed

Some content is hidden

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

432 files changed

+9838
-8105
lines changed

CHANGELOG.md

+35
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,41 @@
44

55
See [README: Change Log](README.md#change-log).
66

7+
## Version 2.7.8 - 8th May 2017
8+
9+
### New Features
10+
11+
* You can now set [Group#updateOnlyExistingChildren](https://photonstorm.github.io/phaser-ce/Phaser.Group.html#updateOnlyExistingChildren) to skip [update](https://photonstorm.github.io/phaser-ce/Phaser.Component.Core.html#update) calls on children with `exists = false` (#187).
12+
* [Phaser.ScaleManager#setUserScale](https://photonstorm.github.io/phaser-ce/Phaser.ScaleManager.html#setUserScale) now has `queueUpdate` and `force` parameters. Set these to false if your [resize callback](https://photonstorm.github.io/phaser-ce/Phaser.ScaleManager.html#setResizeCallback) is being called repeatedly (#197).
13+
* Added [Phaser.Creature#createAllAnimations](https://photonstorm.github.io/phaser-ce/Phaser.Creature.html#createAllAnimations) to force load all animations in a creature mesh. It must be called before [Phaser.Creature#setAnimation](https://photonstorm.github.io/phaser-ce/Phaser.Creature.html#setAnimation).
14+
* Added [Phaser.Creature#setAnimationPlaySpeed](https://photonstorm.github.io/phaser-ce/Phaser.Creature.html#setAnimationPlaySpeed).
15+
* Added [Phaser.Creature.html#height](https://photonstorm.github.io/phaser-ce/Phaser.Creature.html#height) and [Phaser.Creature#width](https://photonstorm.github.io/phaser-ce/Phaser.Creature.html#width). You can set these dimensions directly rather than by using `scale`.
16+
* Added [Phaser.Creature#setAnchorPointEnabled](https://photonstorm.github.io/phaser-ce/Phaser.Creature.html#setAnchorPointEnabled), [Phaser.Creature#anchorX](https://photonstorm.github.io/phaser-ce/Phaser.Creature.html#anchorX), and [Phaser.Creature#anchorY](https://photonstorm.github.io/phaser-ce/Phaser.Creature.html#anchorY) for setting a Creature's anchor point dynamically (still experimental).
17+
18+
### Updates
19+
20+
* Removed the upper limit of 12 for [Phaser.Loader#maxParallelDownloads](https://photonstorm.github.io/phaser-ce/Phaser.Loader.html#maxParallelDownloads). The default value is still 4. Most browsers limit parallel connections to 6 per domain. Older IE and Android browsers may suffer with a value above 4 (#170).
21+
* Arcade Physics Bodies no longer receive angular motion updates while they have [allowRotation](https://photonstorm.github.io/phaser-ce/Phaser.Physics.Arcade.Body.html#allowRotation) disabled, as this was unnecessary.
22+
* [Phaser.Text#align](https://photonstorm.github.io/phaser-ce/Phaser.Text.html#align) can now be set in any case or mix of cases (e.g., 'left', 'Left', 'LEFT').
23+
* [Phaser CE API](https://photonstorm.github.io/phaser-ce/) now shows a synopsis like the Phaser 2.6 docs. You can still find the complete [README](https://github.com/photonstorm/phaser-ce/blob/master/README.md) on GitHub.
24+
* Updated [ScaleManager](https://photonstorm.github.io/phaser-ce/Phaser.ScaleManager.html) docs.
25+
* Clarified `gid` argument in [Phaser.Tilemap#createFromObjects](https://photonstorm.github.io/phaser-ce/Phaser.Tilemap.html#createFromObjects). It can represent an object's `gid`, `id`, or `name`.
26+
* Clarified [Phaser.Image](https://photonstorm.github.io/phaser-ce/Phaser.Image.html)'s use of the Animation component (#185). Images can be animated the same way Sprites can.
27+
28+
### Bug Fixes
29+
30+
* Fixed an issue where Sprites sharing the same texture were distorted or hidden when a WebGLFilter was applied (#39, #153, #154).
31+
* Fixed a 'memory exhausted' error in PIXI.PixiFastShader when compiling shaders with multiTexture enabled.
32+
* Fixed a TypeError in PIXI.WebGLGraphics when trying to render a Graphics object with a missing WebGL context (#178)
33+
* Fixed a ReferenceError in [PIXI.WebGLRenderer](https://photonstorm.github.io/phaser-ce/PIXI.WebGLRenderer.html) when running Phaser in ES5 strict mode.
34+
* Fixed some Typescript definitions (#167).
35+
* Phaser now correctly sets a Creature's anchor point (as set in Creature editor) when a creature mesh is loaded.
36+
* Fixed CreatureManager#CreateAllAnimations crashing in Chrome.
37+
38+
### Thanks
39+
40+
@aaronransley, @andrewjb123, @Cryt1c, @goldfire, @gre, @LandonSchropp, @NickH-nz, @noseglid, @photonstorm, @samme, @tanquetav, @vantreeseba, @vpmedia, @Xan0C
41+
742
## Version 2.7.7 - 20th April 2017
843

944
### Bug Fixes

README.md

+8-25
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Thousands of developers worldwide use Phaser. From indies and multi-national dig
88

99
Phaser v2 was originally built and maintained by the company [Photon Storm](http://www.photonstorm.com), but was turned over to the community in November 2016. [Phaser v3](https://github.com/photonstorm/phaser/tree/master/v3) is in active development.
1010

11-
The [current Phaser CE release is 2.7.7](https://github.com/photonstorm/phaser-ce/releases/tag/v2.7.7).
11+
The [current Phaser CE release is 2.7.8](https://github.com/photonstorm/phaser-ce/releases/tag/v2.7.8).
1212

1313
- **Visit:** The [Phaser website](http://phaser.io) and follow on [Twitter](https://twitter.com/photonstorm) (#[phaserjs](https://twitter.com/hashtag/phaserjs))
1414
- **Learn:** [API Docs](https://photonstorm.github.io/phaser-ce/), [Support Forum][forum] and [StackOverflow](http://stackoverflow.com/questions/tagged/phaser-framework)
@@ -122,11 +122,11 @@ Using Browserify? Please [read this](#browserify).
122122

123123
[Phaser CE is on jsDelivr](http://www.jsdelivr.com/projects/phaser-ce), a "super-fast CDN for developers". Include the following in your html:
124124

125-
<script src="//cdn.jsdelivr.net/phaser-ce/2.7.7/phaser.js"></script>
125+
<script src="//cdn.jsdelivr.net/phaser-ce/2.7.8/phaser.js"></script>
126126

127127
or the minified version:
128128

129-
<script src="//cdn.jsdelivr.net/phaser-ce/2.7.7/phaser.min.js"></script>
129+
<script src="//cdn.jsdelivr.net/phaser-ce/2.7.8/phaser.min.js"></script>
130130

131131
### Web Templates
132132

@@ -258,7 +258,7 @@ If you code with [TypeScript](http://www.typescriptlang.org/) there are comprehe
258258

259259
# Change Log
260260

261-
## Version 2.7.8 - Unreleased
261+
## Version 2.7.8 - 8th May 2017
262262

263263
### New Features
264264

@@ -293,23 +293,6 @@ If you code with [TypeScript](http://www.typescriptlang.org/) there are comprehe
293293

294294
@aaronransley, @andrewjb123, @Cryt1c, @goldfire, @gre, @LandonSchropp, @NickH-nz, @noseglid, @photonstorm, @samme, @tanquetav, @vantreeseba, @vpmedia, @Xan0C
295295

296-
## Version 2.7.7 - 20th April 2017
297-
298-
### Bug Fixes
299-
300-
* Fixed failure to load compressed textures when using URLs with query strings (#166)
301-
* Fixed some TypeScript definitions (#168)
302-
* Fixed missing default values for `resolution` in Phaser.LoaderParser BitmapFont methods (#168).
303-
* Fixed particle [autoAlpha](https://photonstorm.github.io/phaser-ce/Phaser.Particles.Arcade.Emitter.html#autoAlpha) and [autoScale](https://photonstorm.github.io/phaser-ce/Phaser.Particles.Arcade.Emitter.html#autoScale) tweens running at double speed (#160).
304-
* Fixed loading of compressed textures (#17, #162)
305-
* Removed `any` key in [Phaser.Physics.Arcade.Body#checkCollision](https://photonstorm.github.io/phaser-ce/Phaser.Physics.Arcade.Body.html#checkCollision). It was never used, so setting it had no effect (#161). Use `!checkCollision.none` instead.
306-
* Fixed [Phaser.Sound](https://photonstorm.github.io/phaser-ce/Phaser.Sound.html) exception when using IE with AudioTag and high volume values (#157). Now volume is clamped between 0 and 1 in every browser when using AudioTags.
307-
* Fixed incorrect [worldScale](https://photonstorm.github.io/phaser-ce/PIXI.DisplayObject.html#worldScale) calculation (#15)
308-
309-
### Thanks
310-
311-
@fridrisnew, @goldfire, @hdodov, @Peter42, @photonstorm, @samme, @SBCGames, @vpmedia
312-
313296
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser-ce/blob/master/CHANGELOG.md).
314297

315298
<a name="contributing"></a>
@@ -342,10 +325,10 @@ All rights reserved.
342325

343326
[![Analytics](https://ga-beacon.appspot.com/UA-44006568-2/phaser/index)](https://github.com/igrigorik/ga-beacon)
344327

345-
[get-js]: https://github.com/photonstorm/phaser-ce/releases/download/v2.7.7/phaser.js
346-
[get-minjs]: https://github.com/photonstorm/phaser-ce/releases/download/v2.7.7/phaser.min.js
347-
[get-zip]: https://github.com/photonstorm/phaser-ce/archive/v2.7.7.zip
348-
[get-tgz]: https://github.com/photonstorm/phaser-ce/archive/v2.7.7.tar.gz
328+
[get-js]: https://github.com/photonstorm/phaser-ce/releases/download/v2.7.8/phaser.js
329+
[get-minjs]: https://github.com/photonstorm/phaser-ce/releases/download/v2.7.8/phaser.min.js
330+
[get-zip]: https://github.com/photonstorm/phaser-ce/archive/v2.7.8.zip
331+
[get-tgz]: https://github.com/photonstorm/phaser-ce/archive/v2.7.8.tar.gz
349332
[clone-http]: https://github.com/photonstorm/phaser.git
350333
[clone-ssh]: ssh://git@github.com:photonstorm/phaser.git
351334
[clone-svn]: https://github.com/photonstorm/phaser

build/creature.js

+126-1
Original file line numberDiff line numberDiff line change
@@ -6486,10 +6486,74 @@ function Creature(load_data)
64866486
this.boundary_indices = [];
64876487
this.boundary_min = vec2.create();
64886488
this.boundary_max = vec2.create();
6489+
this.anchor_point_map = {};
6490+
this.anchor_points_active = false;
64896491

64906492
this.LoadFromData(load_data);
64916493
};
64926494

6495+
// experimental - must enable - disabled by default
6496+
Creature.prototype.SetAnchorPointEnabled = function(value) {
6497+
this.anchor_points_active = value;
6498+
};
6499+
6500+
Creature.prototype.GetPixelScaling = function(desired_x, desired_y)
6501+
{
6502+
// compute pixel scaling relative to mesh scaling
6503+
this.ComputeBoundaryMinMax();
6504+
6505+
var mesh_size_x = this.boundary_max[0] - this.boundary_min[0];
6506+
var mesh_size_y = this.boundary_max[1] - this.boundary_min[1];
6507+
6508+
var scale_x = 1.0 / mesh_size_x * desired_x;
6509+
var scale_y = 1.0 / mesh_size_y * desired_y;
6510+
6511+
return [scale_x, scale_y];
6512+
};
6513+
6514+
Creature.prototype.SetAnchorPoint = function(x, y, anim_clip_name_in) {
6515+
if (!anim_clip_name_in) {
6516+
anim_clip_name_in = 'default';
6517+
}
6518+
6519+
this.ComputeBoundaryMinMax();
6520+
6521+
var mesh_size_x = this.boundary_max[0] - this.boundary_min[0];
6522+
var mesh_size_y = this.boundary_max[1] - this.boundary_min[1];
6523+
6524+
var target_size_x = this.boundary_max[0];
6525+
var target_size_y = this.boundary_max[1];
6526+
6527+
if (x !== 0) {
6528+
target_size_x = this.boundary_max[0] - (mesh_size_x * (x));
6529+
}
6530+
6531+
if (y !== 0) {
6532+
target_size_y = this.boundary_max[1] - (mesh_size_y * (y));
6533+
}
6534+
6535+
var anchor_point_base = {
6536+
AnchorPoints: [
6537+
{
6538+
point: [target_size_x, target_size_y],
6539+
anim_clip_name: anim_clip_name_in
6540+
}
6541+
]
6542+
};
6543+
6544+
this.anchor_point_map = this.FillAnchorPointMap(anchor_point_base);
6545+
};
6546+
6547+
Creature.prototype.GetAnchorPoint = function(anim_clip_name_in)
6548+
{
6549+
if(anim_clip_name_in in this.anchor_point_map)
6550+
{
6551+
return this.anchor_point_map[anim_clip_name_in];
6552+
}
6553+
6554+
return vec2.fromValues(0, 0);
6555+
};
6556+
64936557
// Fills entire mesh with (r,g,b,a) colours
64946558
Creature.prototype.FillRenderColours = function(r, g, b, a)
64956559
{
@@ -6652,8 +6716,45 @@ Creature.prototype.LoadFromData = function(load_data)
66526716
}
66536717

66546718
this.render_composition.resetToWorldRestPts();
6719+
6720+
// Load Anchor Points
6721+
if("anchor_points_items" in load_data)
6722+
{
6723+
var anchor_point_base = load_data["anchor_points_items"];
6724+
this.anchor_point_map = this.FillAnchorPointMap(anchor_point_base);
6725+
}
66556726
};
66566727

6728+
Creature.prototype.FillAnchorPointMap = function(json_obj)
6729+
{
6730+
var anchor_data_node = json_obj["AnchorPoints"];
6731+
6732+
ret_map = {};
6733+
for (var i = 0; i < anchor_data_node.length; i++)
6734+
{
6735+
var cur_node = anchor_data_node[i];
6736+
var cur_pt = this.ReadVector2JSON(cur_node, "point");
6737+
var cur_name = cur_node["anim_clip_name"];
6738+
6739+
ret_map[cur_name] = cur_pt;
6740+
}
6741+
6742+
return ret_map;
6743+
};
6744+
6745+
6746+
Creature.prototype.ReadVector2JSON = function(data, key)
6747+
{
6748+
var raw_array = this.getFloatArray(data[key]);
6749+
return vec2.fromValues(raw_array[0], raw_array[1]);
6750+
};
6751+
6752+
Creature.prototype.getFloatArray = function(raw_data)
6753+
{
6754+
return raw_data;
6755+
};
6756+
6757+
66576758
// CreatureAnimation
66586759
function CreatureAnimation(load_data, name_in)
66596760
{
@@ -6667,6 +6768,28 @@ function CreatureAnimation(load_data, name_in)
66676768
this.LoadFromData(name_in, load_data);
66686769
};
66696770

6771+
CreatureManager.prototype.AlterBonesByAnchor = function(bones_map, animation_name_in)
6772+
{
6773+
if(this.target_creature.anchor_points_active == false)
6774+
{
6775+
return;
6776+
}
6777+
6778+
var anchor_point = this.target_creature.GetAnchorPoint(animation_name_in);
6779+
for(var cur_bone_key in bones_map)
6780+
{
6781+
var cur_bone = bones_map[cur_bone_key];
6782+
var start_pt = cur_bone.getWorldStartPt();
6783+
var end_pt = cur_bone.getWorldEndPt();
6784+
6785+
start_pt = vec3.subtract(start_pt, start_pt, vec3.fromValues(anchor_point[0], anchor_point[1], 0));
6786+
end_pt = vec3.subtract(end_pt, end_pt, vec3.fromValues(anchor_point[0], anchor_point[1], 0));
6787+
6788+
cur_bone.setWorldStartPt(start_pt);
6789+
cur_bone.setWorldEndPt(end_pt);
6790+
}
6791+
};
6792+
66706793
CreatureAnimation.prototype.LoadFromData = function(name_in, load_data)
66716794
{
66726795
var json_anim_base = load_data["animation"];
@@ -6783,7 +6906,7 @@ CreatureManager.prototype.CreateAllAnimations = function(load_data)
67836906
this.CreateAnimation(load_data, cur_name);
67846907
}
67856908

6786-
this.SetActiveAnimationName (all_animation_names.get(0));
6909+
this.SetActiveAnimationName (all_animation_names[0]);
67876910
};
67886911

67896912
// Add an animation
@@ -7162,6 +7285,8 @@ CreatureManager.prototype.PoseCreature = function(animation_name_in, target_pts)
71627285

71637286
bone_cache_manager.retrieveValuesAtTime(this.getRunTime(),
71647287
bones_map);
7288+
7289+
this.AlterBonesByAnchor(bones_map, animation_name_in);
71657290

71667291
if(this.bones_override_callback != null)
71677292
{

build/creature.map

+1-1
Large diffs are not rendered by default.

build/creature.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/p2.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)