# Dynamic atlas change?

**URL:** <https://forum.defold.com/t/dynamic-atlas-change/63240>\
**Category:** Questions\
**Created:** [September 19, 2019, 2:21pm UTC](https://forum.defold.com/t/dynamic-atlas-change/63240 "2019-09-19T14:21:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kidkiedis](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/k/c57346/32.png) [@kidkiedis](https://forum.defold.com/u/kidkiedis)\
**Post date:** [September 19, 2019, 2:21pm UTC](https://forum.defold.com/t/dynamic-atlas-change/63240/1 "2019-09-19T14:21:10Z")

</div>

Did some research, and it seems like dynamic atlas changing is in this year’s roadmap. So maybe there’s some other way, or maybe it’s been already released and I missed that.

I’am filling an isometric tilemap (room) with instances (furniture) of a default GO with a sprite (atlas and animation defined in editor). While all objects in the room are static and use the same atlas, doors use their own atlases with animations (opening). And it seems like I can’t just **set\_atlas(object, atlas)** for now. Most likely there’s another way. How can I do that? GUI sprites?

Thanks!

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [September 19, 2019, 3:19pm UTC](https://forum.defold.com/t/dynamic-atlas-change/63240/2 "2019-09-19T15:19:03Z")

</div>

> [@kidkiedis](#):
>
> Did some research, and it seems like dynamic atlas changing is in this year’s roadmap. So maybe there’s some other way, or maybe it’s been already released and I missed that.

We are releasing resource properties in the next release (in a week). I will make a post about it tomorrow so that people can try it and give feedback.

---

<div class="post-metadata">

**Author:** ![ross.grams](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/r/cab0a1/32.png) [@ross.grams](https://forum.defold.com/u/ross.grams)\
**Post date:** [September 19, 2019, 3:21pm UTC](https://forum.defold.com/t/dynamic-atlas-change/63240/3 "2019-09-19T15:21:32Z")

</div>

You can’t just use a separate game object for your doors?

---

<div class="post-metadata">

**Author:** ![kidkiedis](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/k/c57346/32.png) [@kidkiedis](https://forum.defold.com/u/kidkiedis)\
**Post date:** [September 20, 2019, 9:11am UTC](https://forum.defold.com/t/dynamic-atlas-change/63240/4 "2019-09-20T09:11:48Z")

</div>

Defold team, you’re awesome!)

---

<div class="post-metadata">

**Author:** ![kidkiedis](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/k/c57346/32.png) [@kidkiedis](https://forum.defold.com/u/kidkiedis)\
**Post date:** [September 20, 2019, 9:21am UTC](https://forum.defold.com/t/dynamic-atlas-change/63240/5 "2019-09-20T09:21:28Z")

</div>

Thanks! Sure, that’s what I’ll do. But still we have a location with 5-10 rooms, and each room has it’s own atlas with floor texture and objects as sprites. There’s always only one room on your screen at a time, so map re-initiates each time character moves from one room to another. I.e. we need to change atlas anyway.

---

<div class="post-metadata">

**Author:** ![Lex](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lex/32/23856_2.png) [@Lex](https://forum.defold.com/u/Lex)\
**Post date:** [June 15, 2021, 3:56pm UTC](https://forum.defold.com/t/dynamic-atlas-change/63240/6 "2021-06-15T15:56:26Z")

</div>

Is there now a way to generate atlas dynamically?

I have a Spine character, I’d like to be able to generate infinite combinations of this character, based on a set of separate PNGs that I’d like to build the atlas with.

Has anyone done it? Do you know if it’s possible to do it within the Defold?

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [June 15, 2021, 5:39pm UTC](https://forum.defold.com/t/dynamic-atlas-change/63240/7 "2021-06-15T17:39:54Z")

</div>

> [@Lex](#):
>
> I have a Spine character, I’d like to be able to generate infinite combinations of this character, based on a set of separate PNGs that I’d like to build the atlas with.
> 
> Has anyone done it? Do you know if it’s possible to do it within the Defold?

You can modify/change the contents of an existing atlas at runtime. BUT for this to be useful you also need to know which part of the atlas to change. So you either have to hardcode this or also include the original .atlas file as a custom resource and load and parse it to know the location within the atlas.

I believe @Pkeod created an example of how to do this for a sprite. The principle is the same for the atlas used by a Spine model.

Here’s one forum thread and a solution by @Pkeod : [Dynamic creation of the atlas in the script - #26 by Pkeod](https://forum.defold.com/t/dynamic-creation-of-the-atlas-in-the-script/24404/26) (there are probably more threads discussing this)

> [@Lex](#):
>
> infinite combinations of this character

If you can settle for less than infinite then there’s also the spine skin functionality (spine.set\_skin()) where you can change the image used by one part of a model.

---

<div class="post-metadata">

**Author:** ![Lex](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lex/32/23856_2.png) [@Lex](https://forum.defold.com/u/Lex)\
**Post date:** [June 16, 2021, 1:02pm UTC](https://forum.defold.com/t/dynamic-atlas-change/63240/8 "2021-06-16T13:02:13Z")

</div>

Thanks for your response.  
I found a way using skins!
