Auto-layers are actually based on IntGrid layers with a twist: they have a Tileset linked to them and rules to paint tiles automatically.
![](https://ldtk.io/wp-content/uploads/2020/11/autoLayer-demo2.gif)
Creating an IntGrid auto-layer
Step 1 – Create a Tileset
You can use the free tileset Cavernas from Adam Saltsman for your tests.
![](https://ldtk.io/wp-content/uploads/2020/12/image-9.png)
![](https://ldtk.io/wp-content/uploads/2020/12/createTileset.png)
![](https://ldtk.io/wp-content/uploads/2020/12/Tileset-Cavernas-835x1024.png)
Step 2 – Create an IntGrid layer
![](https://ldtk.io/wp-content/uploads/2020/12/image.png)
![](https://ldtk.io/wp-content/uploads/2022/02/createLayer.png)
![](https://ldtk.io/wp-content/uploads/2022/02/layerSettings.png)
![](https://ldtk.io/wp-content/uploads/2020/12/AutoLayer.png)
Step 3 – Add some rules
![](https://ldtk.io/wp-content/uploads/2020/12/image-13.png)
![](https://ldtk.io/wp-content/uploads/2020/12/image-14.png)
![](https://ldtk.io/wp-content/uploads/2020/12/image-15.png)
Important
There are actually 2 types of auto-layers:
- IntGrid layers with rules: just a normal IntGrid layer with a tileset attached, as shown above.
- Pure auto-layers: this distinct layer type only contain rules, and takes its source data from another separate IntGrid layer. Pure auto-layers can be really useful if you want to render separate foreground and background layers using a single IntGrid source.
How rules work?
Here is the rule editor window:
![](https://ldtk.io/wp-content/uploads/2020/12/image-18.png)
Rules are grid patterns that will decide if a specific tile should be painted on your layer.
Here is a simple rule:
![](https://ldtk.io/wp-content/uploads/2020/12/image-19.png)
It says “Paint the tile on the left if” :
- in any given cell, there is a “collision” IntGrid value (white)
- AND there is no “collision” value above.
And here is another one:
![](https://ldtk.io/wp-content/uploads/2020/12/image-17.png)
This second one means: “Paint the tile on the left if any given grid cell contains a “collision” value“.
With these 2 rules, if you add collisions to your layer, the tiles will be drawn automatically:
![](https://ldtk.io/wp-content/uploads/2020/12/AutoLayer-ExampleDemo.gif)
If you press SHIFT+R or uncheck the Render option in the Rules panel, you will see the “pure” IntGrid layer, without the tiles:
![](https://ldtk.io/wp-content/uploads/2020/12/AutoLayer-RenderDemo.gif)