Skip to content
UnbelievableFlavour edited this page Jun 7, 2022 · 5 revisions

Layers

Layers in LDtk can be of various types. Each one supports different kind of data. They can be organized from the Layer panel using simple drag and drop.

LDtk layer

All current layers are supported in Cotton. (integer grid, entities, tiles, auto-layer)

Video tutorial

There is a couple of different layers. I personally found this tutorial to be explaining the different layers types quitte well. Video: Tutorial

Different types of layers

Integer grid

These layers are grids of Integer values (ie. 1, 2, 3 etc.). Each value is associated with a color and an optional string identifier (for easier access in your code). We use this layer for determining collisions. Check the example project for collision configurations.

You can learn how to use IntGrid layers in this tutorial.

Tiles

Tile layers contain bitmap images organized in a grid. These layers must be linked to an existing Tileset to work.

You can learn how to use Tile layers in this tutorial.

Entities

These layers host Entity instances, which can be placed along the grid or in free mode.

You can learn more about Entities in this article.

Auto-layer

Auto-layers are actually based on IntGrid layers with a twist: they have a Tileset linked to them and rules to paint tiles automatically.

You can learn how to use Auto-layer layers in this tutorial.

Clone this wiki locally