Skip to content

Commit bcd0163

Browse files
committed
ComponentClip clip textures argument can be either String or Array of strings
1 parent 44857ae commit bcd0163

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/clip/ComponentClip.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const TYPE_ZONE = "zone";
6969
*
7070
* @param {Phaser.Scene} scene Phaser scene to create component at
7171
* @param {ComponentConfig} config jsfl-generated config object
72-
* @param {Array<String>} textures Array of texture names, where component should find its texture frames
72+
* @param {Array<String>|String} textures texure name or Array of texture names, where component should find its texture frames
7373
*/
7474
export default class ComponentClip extends Phaser.GameObjects.Container {
7575
constructor(scene, config, textures) {
@@ -92,7 +92,7 @@ export default class ComponentClip extends Phaser.GameObjects.Container {
9292
* list of texture names to use in this component
9393
* @type {Array<String>}
9494
* */
95-
this._textures = textures;
95+
this._textures = Array.isArray(textures) ? textures : [textures];
9696

9797
/**
9898
* Texture frames to texture names map

0 commit comments

Comments
 (0)