Hi all,
I am trying to create a group from several frames of an atlas (json), but none of the created elements use the frames that I indicate, they only use the first frame of the atlas.
I have been able to add images, sprites and animations with the atlas.
This is my code:
this.meteors = this.physics.add.group();
this.meteors.createMultiple({
classType: Meteor,
key: 'atl_asteroids',
frame: ['009_asteroid1','010_asteroid2', '011_asteroid3','012_asteroid4'],
frameQuantity: 10,
//randomFrame: true,
max: t.conf.meteors_qty*4
});
This is a reduced version of the atlas:
{
"frames": {
"000_Ship2": {
"frame": { "x": 0, "y": 0, "w": 62, "h": 55 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 62, "h": 55 },
"sourceSize": { "w": 62, "h": 55 }
},
"001_Ship1": {
"frame": { "x": 121, "y": 0, "w": 62, "h": 55 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 62, "h": 55 },
"sourceSize": { "w": 62, "h": 55 }
}
},
"meta": {
"image": "spritesheet.png",
"size": { "w": 1190, "h": 604 },
"scale": 1
}
}
What am I missing?
Thanks in advance.