Skip to content
UnbelievableFlavour edited this page Jun 29, 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.

Unsupported features

Tile Stacking

Tile stacking is found under the following button in LDtk. Due to the structure of the LDtk API adapter. This is is currently not supported. Make sure you leave this feature disabled. Screenshot 2022-06-29 at 13 44 27