You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,7 @@ Significant API changes:
48
48
49
49
* Loader.tileset has a new method signature. Please use the new format: load.tileset(key, url, tileWidth, tileHeight, tileMargin, tileSpacing, rows, columns, total).
50
50
* TilemapLayers are now created via the Tilemap object itself: map.createLayer(x, y, width, height, tileset, layer, group) and no longer via the GameObjectFactory.
51
+
* Tilemap.createFromObjects can now turn a bunch of Tiled objects into Sprites in one single call, and copies across all properties as well.
51
52
52
53
53
54
New features:
@@ -60,6 +61,7 @@ New features:
60
61
* TilemapLayers now have debug and debugAlpha values, this turns on the drawing of the collision edges (very handy for debugging, as the name implies!)
61
62
* Tweens have a new event: onLoop.
62
63
* You can now load any binary file via the Loader: game.load.binary(key, url, callback) - the optional callback allows for post-load processing before entering the Cache.
64
+
* Group.set will let you deep set a new propery on a single child of the Group.
Copy file name to clipboardExpand all lines: src/core/Group.js
+36Lines changed: 36 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -335,6 +335,11 @@ Phaser.Group.prototype = {
335
335
336
336
},
337
337
338
+
/**
339
+
* Internal test.
340
+
*
341
+
* @method Phaser.Group#childTest
342
+
*/
338
343
childTest: function(prefix,child){
339
344
340
345
vars=prefix+' next: ';
@@ -363,6 +368,11 @@ Phaser.Group.prototype = {
363
368
364
369
},
365
370
371
+
/**
372
+
* Internal test.
373
+
*
374
+
* @method Phaser.Group#swapIndex
375
+
*/
366
376
swapIndex: function(index1,index2){
367
377
368
378
varchild1=this.getAt(index1);
@@ -634,6 +644,32 @@ Phaser.Group.prototype = {
634
644
635
645
},
636
646
647
+
/**
648
+
* This function allows you to quickly set a property on a single child of this Group to a new value.
649
+
* The operation parameter controls how the new value is assigned to the property, from simple replacement to addition and multiplication.
650
+
*
651
+
* @method Phaser.Group#set
652
+
* @param {Phaser.Sprite} child - The child to set the property on.
653
+
* @param {string} key - The property, as a string, to be set. For example: 'body.velocity.x'
654
+
* @param {*} value - The value that will be set.
655
+
* @param {boolean} [checkAlive=false] - If set then the child will only be updated if alive=true.
656
+
* @param {boolean} [checkVisible=false] - If set then the child will only be updated if visible=true.
657
+
* @param {number} [operation=0] - Controls how the value is assigned. A value of 0 replaces the value with the new one. A value of 1 adds it, 2 subtracts it, 3 multiplies it and 4 divides it.
* Creates a Sprite for every object matching the given gid in the map data. You can optionally specify the group that the Sprite will be created in. If none is
195
+
* given it will be created in the World. All properties from the map data objectgroup are copied across to the Sprite, so you can use this as an easy way to
196
+
* configure Sprite properties from within the map editor. For example giving an object a property if alpha: 0.5 in the map editor will duplicate that when the
197
+
* Sprite is created. You could also give it a value like: body.velocity.x: 100 to set it moving automatically.
198
+
*
199
+
* @method Phaser.Tileset#createFromObjects
200
+
* @param {number} gid - The layer array index value, or if a string is given the layer name, within the map data that this TilemapLayer represents.
201
+
* @param {string} key - The Game.cache key of the image that this Sprite will use.
202
+
* @param {number|string} [frame] - If the Sprite image contains multiple frames you can specify which one to use here.
203
+
* @param {boolean} [exists=true] - The default exists state of the Sprite.
204
+
* @param {boolean} [autoCull=true] - The default autoCull state of the Sprite. Sprites that are autoCulled are culled from the camera if out of its range.
205
+
* @param {Phaser.Group} [group] - Optional Group to add the Sprite to. If not specified it will be added to the World group.
0 commit comments