# How to load sprite atlas

**URL:** https://discourse.mapeditor.org/t/how-to-load-sprite-atlas/775
**Category:** Questions
**Created:** [September 24, 2015, 4:48pm UTC](https://discourse.mapeditor.org/t/how-to-load-sprite-atlas/775 "2015-09-24T16:48:05Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![aslas](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@aslas](https://discourse.mapeditor.org/u/aslas)
#### Post date: [September 24, 2015, 4:48pm UTC](https://discourse.mapeditor.org/t/how-to-load-sprite-atlas/775/1 "2015-09-24T16:48:05Z")

</div>

![](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/1X/231e75cd25205b6bc96138ec7ad847890dd887e0.png)

All sprites are 32 x 32, tile size is also. Do I need to set margins or offset?

---

<div class="post-metadata">

### Author: ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)
#### Post date: [September 24, 2015, 8:06pm UTC](https://discourse.mapeditor.org/t/how-to-load-sprite-atlas/775/2 "2015-09-24T20:06:37Z")

</div>

Already saw this answered on IRC. It seems indeed like the tiles have some spacing in between and may have a margin as well. In the “New Tileset” dialog, the “Margin” means the space at the edges of the image and the “Spacing” means the space between the tiles.

---

<div class="post-metadata">

### Author: ![aslas](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@aslas](https://discourse.mapeditor.org/u/aslas)
#### Post date: [September 25, 2015, 6:58am UTC](https://discourse.mapeditor.org/t/how-to-load-sprite-atlas/775/3 "2015-09-25T06:58:27Z")

</div>

I know what those things mean. I am asking why it makes like this with this tileset. If I load some ready tileset from web, it goes right.

---

<div class="post-metadata">

### Author: ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)
#### Post date: [September 25, 2015, 8:00am UTC](https://discourse.mapeditor.org/t/how-to-load-sprite-atlas/775/4 "2015-09-25T08:00:01Z")

</div>

If it does that then you got the parameters wrong. In order to help you find the right parameters, you’d have to upload the actual tileset image you’re using instead of the screenshot.

---

<div class="post-metadata">

### Author: ![aslas](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@aslas](https://discourse.mapeditor.org/u/aslas)
#### Post date: [September 25, 2015, 11:19am UTC](https://discourse.mapeditor.org/t/how-to-load-sprite-atlas/775/5 "2015-09-25T11:19:04Z")

</div>

Here is original tileset made with TexturePacker.  
 ![](https://canada1.discourse-cdn.com/flex035/uploads/mapeditor/original/1X/dab40bc72d61e5a64669019220a151feb5adcdaa.png)

---

<div class="post-metadata">

### Author: ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)
#### Post date: [September 25, 2015, 7:43pm UTC](https://discourse.mapeditor.org/t/how-to-load-sprite-atlas/775/6 "2015-09-25T19:43:07Z")

</div>

> [@aslas](#):
>
> Here is original tileset made with TexturePacker.

So it seems to me, that you’ve configured TexturePacker to leave some space around your images as well as a one pixel space between your images. This means that when adding this image as a tileset in Tiled, you need to choose 1 px margin and 1 px spacing (along with a 32 px tile size).

---

<div class="post-metadata">

### Author: ![aslas](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@aslas](https://discourse.mapeditor.org/u/aslas)
#### Post date: [September 26, 2015, 8:45am UTC](https://discourse.mapeditor.org/t/how-to-load-sprite-atlas/775/7 "2015-09-26T08:45:05Z")

</div>

Now it works. Thank you!
