Is it possible: Place object for every selected tile

Imagine having a tile-layer with just sprites of a wall on it:
Is it possible to create an object on every tile, that has a wall-sprite on it?

Or is it possible to select some tiles (for example water-tiles) and creating objects on every tile, that is selected?

Hey @Sgt_Hemmi, welcome to the Tiled forums!

First of all I wonder a little about the purpose of doing this. What would you do with all these objects? What information will they add?

Assuming you really need these objects, you could automate the placement of these object in two ways:

  • The Automapping feature allows creation of objects based on matching tile patterns. On Windows, Tiled ships with an example of this in the “examples/sewer_automap” folder. You can also find this example in the repository. Rules 008 and 009 place an object.

  • The scripting API enables you to iterate all tiles of a tile layer or just the selected tiles in JavaScript, as well as allowing you to place objects. See the rectangle-chain example for how to place objects using a tool (though, you’d probably want to do so using a custom action, like find-object-by-id).

Hey there!
Im using pytmx and i place on every tile, that has an object called "wall" an obstacle, so players cant move on that tile. The idea was having a layer with painted walls and creating objects on every painted tile on that layer.
But i already figured out how to program a function in pytmx so its placing an obstacle on every visible tile.
But thanks for the ideas!

1 Like

You can assign collision to tiles in your tileset and draw upon that data in your game, as well.