# How can I get image names on objects?

**URL:** <https://discourse.mapeditor.org/t/how-can-i-get-image-names-on-objects/1964>\
**Category:** Questions\
**Created:** [January 17, 2017, 12:15pm UTC](https://discourse.mapeditor.org/t/how-can-i-get-image-names-on-objects/1964 "2017-01-17T12:15:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_Ramos](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/jeff_ramos/32/977_2.png) [@Jeff\_Ramos](https://discourse.mapeditor.org/u/Jeff_Ramos)\
**Post date:** [January 17, 2017, 12:15pm UTC](https://discourse.mapeditor.org/t/how-can-i-get-image-names-on-objects/1964/1 "2017-01-17T12:15:11Z")

</div>

Hey, congrats for the tool =)

Hi, I’m using tilesets images to place on my level, but I dont know how get the name of the image i’m using.  
There some way to get the name of the image inside an object? or some reference to I can find this? Will be painful to add a custom properties there just with the name of the image to use on my game.

Thanks =D

![](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/mapeditor/original/1X/3dd7e5dda629f52255cb3394df5dbc53d7efb3e1.jpg)

---

<div class="post-metadata">

**Author:** ![faulknermano](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/faulknermano/32/1037_2.png) [@faulknermano](https://discourse.mapeditor.org/u/faulknermano)\
**Post date:** [February 15, 2017, 8:37pm UTC](https://discourse.mapeditor.org/t/how-can-i-get-image-names-on-objects/1964/2 "2017-02-15T20:37:46Z")

</div>

Hi, I’d like to +1 this as a question and suggestion.

In addition to that, it would be helpful to be able to replace, from within the editor, the Tile being referenced. (I’ve decided to use Object Layers to put in the sprites instead of the Tiles because some tiles are bigger than the logical tile dimensions. But creating a map without the usual Tile tools is a bit cumbersome.

Perhaps a workflow like this?:

1. selecting the Image Object/s
2. selecting the Tile in the tileset window
3. RMB \> Replace image in selected object/s

… or something like that.

Thanks for reading. 🙂

---

<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:** [February 21, 2017, 9:05am UTC](https://discourse.mapeditor.org/t/how-can-i-get-image-names-on-objects/1964/3 "2017-02-21T09:05:20Z")

</div>

> [@Jeff\_Ramos](#):
>
> Hi, I’m using tilesets images to place on my level, but I dont know how get the name of the image i’m using.There some way to get the name of the image inside an object? or some reference to I can find this? Will be painful to add a custom properties there just with the name of the image to use on my game.

In the map file, each tile object will have a `gid` attribute, which is a global tile ID pointing to a tile in one of the tilesets referenced by the map. You find the name of the image at the definition of the tileset or the tile (in case of an image collection tileset). This `gid` value works the same way as it does for tile layers, which is [explained here](http://doc.mapeditor.org/reference/tmx-map-format/#data).

There is also the following related issue, for displaying the image name in Tiled:

> <https://github.com/mapeditor/tiled/issues/964>
>
> Hey, I hope it is okay to add such things here. If not, my humble apologies :)
> 
> …While creating maps where I positioned extremely similar but not identical background tiles at specific places it would have been useful if there was an option to overlay the name or some other identifier of the source image of a tile above it in the tile selection window and/or the map window, so I wouldn't need to strain my eyes as much making sure I selected the correct images.
> 
> Maybe I'll see about contributing this myself if I got the time in a few days and I succeed in getting the build environment set up.
> 
> Of course I have no idea how useful this would be for other people or how widespread use cases are where this is relevant. Any opinions?

> [@faulknermano](#):
>
> In addition to that, it would be helpful to be able to replace, from within the editor, the Tile being referenced.

Definitely. The feature is covered by the following issue:

> <https://github.com/mapeditor/tiled/issues/409>
>
> When creating a new object with the "Insert Tile Objects" tool, you can't change… its tile anymore. 
> 
> In the game I am currently making, there is a huge amount of objects that take appearance of different terrain tiles, but they all have the same properties inside. It would be a big hassle to create each individual object with the Insert Tile Object tool and then write all of its properties by hand, as opposed to simply copying and pasting one of them and changing its corresponding tile.
> 
> Anyway, I've already solved this by using a tile layer, but I believe this issue could be easily fixed and would be very useful for other developers.
> 
> Sorry if it sounded confusing, English is not my first language.

I like your suggestion of adding it to a context menu on the tile.
