# How to provide separate sprites to SpriteManager

**URL:** <https://forum.babylonjs.com/t/how-to-provide-separate-sprites-to-spritemanager/39208>\
**Category:** Questions\
**Tags:** sprite\
**Created:** [March 21, 2023, 1:06am UTC](https://forum.babylonjs.com/t/how-to-provide-separate-sprites-to-spritemanager/39208 "2023-03-21T01:06:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![indiegamedev](https://avatars.discourse-cdn.com/v4/letter/i/ea666f/32.png) [@indiegamedev](https://forum.babylonjs.com/u/indiegamedev)\
**Post date:** [March 21, 2023, 1:06am UTC](https://forum.babylonjs.com/t/how-to-provide-separate-sprites-to-spritemanager/39208/1 "2023-03-21T01:06:19Z")

</div>

I’ve been looking at the example for SpriteManager however I cannot find a way to provide separate sprites instead of spritesheet or sprite atlas.

> **[Babylon.js Playground](https://www.babylonjs-playground.com/#FF1NCP)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

What I would like to do is to give an array (or a structure that Babylon accepts) of separate images like this. The thing is my assets library is mostly made of separate images like this and I don’t want to convert them to spritesheets.

[“walk1.png”, “walk2.png”, “walk3.png”]

Any ideas?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [March 21, 2023, 10:08am UTC](https://forum.babylonjs.com/t/how-to-provide-separate-sprites-to-spritemanager/39208/2 "2023-03-21T10:08:36Z")

</div>

I don’t think we can do that, except by creating as many sprite managers as you have sprites. It’s possible to do this if you only have a small number of sprites, but it’s not practical if you have dozens or more.

Instead, you will need to create a helper function to create a single texture from a list of images and pass it to the sprite manager constructor.

---

<div class="post-metadata">

**Author:** ![indiegamedev](https://avatars.discourse-cdn.com/v4/letter/i/ea666f/32.png) [@indiegamedev](https://forum.babylonjs.com/u/indiegamedev)\
**Post date:** [March 21, 2023, 10:26am UTC](https://forum.babylonjs.com/t/how-to-provide-separate-sprites-to-spritemanager/39208/3 "2023-03-21T10:26:28Z")

</div>

Thanks. Yeah, I think there’s no way to do that. Weird design. But anyway.

I’ve used this below package to create a spritesheet on the fly that Babylon wants. Before I use SpriteManager, I send separate images to a function that uses this library. The function returns a blob and I use this blob image as the texture URL. Works fine and I don’t need to pre-format my images in TexturePacker or similar. Pretty light library.

> **[merge-images](https://www.npmjs.com/package/merge-images)**
>
> Easily compose images together without messing around with canvas. Latest version: 2.0.0, last published: 3 years ago. Start using merge-images in your project by running \`npm i merge-images\`. There are 41 other projects in the npm registry using...
