mirror of
https://github.com/photonstorm/phaser
synced 2024-11-30 08:31:01 +00:00
Fixed Layer.add return result. Updated createMultiple so that the setXY etc options are only applied to the newly created entities.
This commit is contained in:
parent
93d7ed30fc
commit
664b154e02
2 changed files with 8 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
|||
var CHECKSUM = {
|
||||
build: 'e2f72850-1405-11e7-9a6b-33fd46b9f183'
|
||||
build: 'd49bfab0-140a-11e7-94bb-359300de1e55'
|
||||
};
|
||||
module.exports = CHECKSUM;
|
|
@ -49,7 +49,9 @@ var Layer = new Class({
|
|||
|
||||
child.visible = visible;
|
||||
|
||||
return this.add(child);
|
||||
this.add(child);
|
||||
|
||||
return child;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -135,24 +137,24 @@ var Layer = new Class({
|
|||
entries.push(this.create(0, 0, range[i].a, range[i].b, visible));
|
||||
}
|
||||
|
||||
// Post-creation options:
|
||||
// Post-creation options (applied only to those items created in this call):
|
||||
|
||||
var x = GetObjectValue(options, 'setXY.x', 0);
|
||||
var y = GetObjectValue(options, 'setXY.y', 0);
|
||||
var stepX = GetObjectValue(options, 'setXY.stepX', 0);
|
||||
var stepY = GetObjectValue(options, 'setXY.stepY', 0);
|
||||
|
||||
this.setXY(x, y, stepX, stepY);
|
||||
Actions.SetXY(entries, x, y, stepX, stepY);
|
||||
|
||||
var rotation = GetObjectValue(options, 'setRotation.value', 0);
|
||||
var stepRotation = GetObjectValue(options, 'setRotation.step', 0);
|
||||
|
||||
this.setRotation(rotation, stepRotation);
|
||||
Actions.SetRotation(entries, rotation, stepRotation);
|
||||
|
||||
var alpha = GetObjectValue(options, 'setAlpha.value', 1);
|
||||
var stepAlpha = GetObjectValue(options, 'setAlpha.step', 0);
|
||||
|
||||
this.setAlpha(alpha, stepAlpha);
|
||||
Actions.SetAlpha(entries, alpha, stepAlpha);
|
||||
|
||||
return entries;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue