# ldtk (deepnight/ldtk)

> LDtk (Level Designer Toolkit) is a modern, lightweight and efficient open-source 2D level editor for designing game levels.

- GitHub: https://github.com/deepnight/ldtk
- GitHub.Locker page: https://github.locker/deepnight/ldtk
- Stars: 5K
- Language: Haxe
- License: MIT
- Last push: 2026-11-15

## Questions and answers

Written by GitHub.Locker from the README and the repository; check the README below for details.

**Is it a game engine or just a level editor?**

It is a level editor, not a game engine. The app is a standalone 2D editor built on Electron, with Haxe used for its code.

**How do I get it running?**

Download the latest version from LDtk.io. To build from source, run it from the app folder after installing the Haxe libs and Electron through NPM.

**Do I need Haxe and Node.js to use it?**

Not for the prebuilt app. Building from source needs an up-to-date Haxe install and NPM, which comes bundled with NodeJS.

**Is it safe to try the dev branches?**

Not for everyday work. The dev-x.y.z branches may be unstable or broken and change quickly, so you will need to update the Haxe libs often.

**Which operating systems does it run on?**

The README does not name specific operating systems. It is an Electron desktop app, so it targets desktop systems.

**Can I run LDtk inside the Hide editor?**

Yes. Build the Hide plugin, then add LDtk to Hide's res/props.json. It opens in its own tab and its CastleDB enum sync reads Hide's live database, including unsaved changes.

**Can it run without Electron?**

Yes. The renderer can also run standalone in NW.js, without the Electron main process.

**Is there a Haxe API for LDtk?**

Yes, a Haxe API is hosted separately on GitHub. When you build a dev branch, switch the API to the same branch as the LDtk repo.


---

## README (checked against GitHub 2026-11-18)

Source: https://github.com/deepnight/ldtk/blob/master/README.md

![](https://github.com/deepnight/ldtk/blob/master/app/assets/appIcon.png)

**Level Designer Toolkit** (*LDtk*) is a **modern**, **efficient** and **open-source** 2D level editor with a strong focus on user-friendliness.

Links: [Official website](https://ldtk.io/) | [Haxe API (on GitHub)](https://github.com/deepnight/ldtk-haxe-api)

[![GitHub Repo stars](https://img.shields.io/github/stars/deepnight/ldtk?color=%23dca&label=%E2%AD%90)](https://github.com/deepnight/ldtk)
[![GitHub All Releases](https://img.shields.io/github/downloads/deepnight/ldtk/total?color=%2389b&label=Downloads)](https://github.com/deepnight/ldtk/releases/latest)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/deepnight/ldtk/test-windows.yml?label=LDtk%20build)](https://github.com/deepnight/ldtk/actions/workflows/test-windows.yml)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/deepnight/ldtk-haxe-api/unitTests.yml?label=Unit%20tests)](https://github.com/deepnight/ldtk-haxe-api/actions/workflows/unitTests.yml)

# Getting LDtk latest version

Visit [LDtk.io](https://ldtk.io) to get latest version.

# Building from source

## Requirements

 - **[Haxe compiler](https://haxe.org)**: you need an up-to-date and working Haxe install  to build LDtk.
 - **[NPM](https://nodejs.org/en/download/)**: this package manager is used for various install and packaging scripts. It is packaged with NodeJS.

## Installing required stuff

 - Open a command line **in the `ldtk` root dir**,
 - Install required Haxe libs:
 ```
 haxe setup.hxml
 ```
 - Install Electron locally and other dependencies through NPM (**IMPORTANT**: you need to be in the `app` dir):
 ```
 cd app
 npm i
 ```

## Compiling *master* branch

First, from the root of the repo, build the electron **Main**:

```
haxe main.debug.hxml
```

This should create a `app/assets/main.js` file.

Then, build the electron **Renderer**:

```
haxe renderer.debug.hxml
```

This should create `app/assets/js/renderer.js`.

## Compiling another branch

If you want to try a future version of LDtk, you can checkout branches named `dev-x.y.z` where x.y.z is version number.

**IMPORTANT**:
 - these *dev* branches might be unstables, or even broken. Therefore, it's not recommended to use, unless you plan to add or fix something on LDtk.
 - because *dev* branches might change quickly, you will need to update haxelibs often.
 - you will need to switch the *LDtk haxe API* to the **same** branch as LDtk repo. (adapt the branch name below accordingly):

```
haxelib git ldtk-haxe-api https://github.com/deepnight/ldtk-haxe-api.git dev-0.6.0
```

## Running

From a command line in the `app` folder, run:

```
npm run start
```

## Running inside Hide (as an editor plugin)

LDtk can run embedded in a [Hide](https://github.com/heapsio/hide) tab.

First build the plugin (from the `ldtk` root dir):

```
haxe hide-plugin.hxml
```

This creates `app/nwjs/hide-plugin.js` (sources in `src/hide/plugin/`). Then add to the Hide project's `res/props.json` (`ldtk.project` is optional and resolves relative to `res/`):

```json
"plugins": [ "/path/to/ldtk/app/nwjs/hide-plugin.js" ],
"menu.extra": "<menu label='LDtk' component='ldtk.LdtkView'></menu>",
"ldtk.project": "path/to/world.ldtk"
```

LDtk then opens from the menu, in its own tab. Bonus: its CastleDB enum sync reads Hide's live database, unsaved changes included.

## Running in NW.js (instead of Electron)

The renderer can also run standalone in [NW.js](https://nwjs.io/), without the Electron main process:

```
nw app/nwjs
```

# Contributing

You can read the general Pull Request guidelines here:
https://github.com/deepnight/ldtk/wiki#pull-request-guidelines

# Related tools & licences

 - Tileset images: see [README](app/extraFiles/samples/README.md) in samples
 - Haxe: https://haxe.org/
 - Heaps.io: https://heaps.io/
 - Electron: https://www.electronjs.org/
 - JQuery: https://jquery.com
 - MarkedJS: https://github.com/markedjs/marked
 - SVG icons from https://material.io
 - Default palette: "*Endesga32*" by Endesga (https://lospec.com/palette-list/endesga-32)
 - Default color blind palette: "*Colorblind 16*" by FilipWorks (https://github.com/filipworksdev/colorblind-palette-16)

