mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 05:33:35 +00:00
Added imageStack Factory function.
This commit is contained in:
parent
4723ef0caa
commit
016fda7660
1 changed files with 25 additions and 0 deletions
|
@ -72,6 +72,31 @@ var Factory = new Class({
|
|||
return body;
|
||||
},
|
||||
|
||||
imageStack: function (key, frame, x, y, columns, rows, columnGap, rowGap, options)
|
||||
{
|
||||
if (columnGap === undefined) { columnGap = 0; }
|
||||
if (rowGap === undefined) { rowGap = 0; }
|
||||
if (options === undefined) { options = {}; }
|
||||
|
||||
var world = this.world;
|
||||
var displayList = this.sys.displayList;
|
||||
|
||||
options.addToWorld = false;
|
||||
|
||||
var stack = Composites.stack(x, y, columns, rows, columnGap, rowGap, function (x, y)
|
||||
{
|
||||
var image = new MatterImage(world, x, y, key, frame, options);
|
||||
|
||||
displayList.add(image);
|
||||
|
||||
return image.body;
|
||||
});
|
||||
|
||||
world.add(stack);
|
||||
|
||||
return stack;
|
||||
},
|
||||
|
||||
stack: function (x, y, columns, rows, columnGap, rowGap, callback)
|
||||
{
|
||||
var stack = Composites.stack(x, y, columns, rows, columnGap, rowGap, callback);
|
||||
|
|
Loading…
Reference in a new issue