Skip to content
Back to projects

Tiles

A layer-based 2D map editor for building tile worlds from your own texture atlases. A custom OpenGL batch renderer under the hood, brush and fill tools, and a flexible layer-to-PNG export matrix. Built for Windows in C++.

January 8, 2025
C++OpenGLImGuiGraphics
Tiles

Tiles is a 2D map editor for building detailed tile worlds out of your own texture atlases. I wanted a focused, modern take on tile-map editing, and I wanted to write the whole thing myself, the renderer included, rather than lean on a game engine to do the heavy lifting.

Why I built it

Tile editors already exist, and good ones. But I wanted my own streamlined version, and more than that, I wanted the excuse to build the rendering from the ground up. A map editor is a great project for exactly that: it needs a fast 2D renderer for a grid of thousands of tiles, and a real editing interface sitting on top of it. So I built both.

What it does

Importing and selecting from a texture atlasImporting and selecting from a texture atlas

The layer panelThe layer panel

Brush attributes: rotation, size, and tintBrush attributes: rotation, size, and tint

The export render matrix, grouping layers into PNGsThe export render matrix, grouping layers into PNGs

How it works

Tiles doesn't sit on a game engine. It ships with its own built-in application framework, and at the center of that is a state-based batch 2D renderer written in OpenGL, handling the pipeline, the window, and real-time editing. The interface (the layer panel, brush attributes, atlas selection) is built on an immediate-mode UI.

Batching is what makes it feel instant. A tile map is thousands of little quads, and drawn one at a time that would crawl. The renderer collects them into batches and pushes each in a single draw, so painting across a big map stays smooth instead of dragging as it fills in.

The rendering layer took its cues from TheCherno's Walnut framework, and the editor itself from the Tiled map editor, the goal being a leaner, more modern take on tile-based world building.

Example maps

A few maps built entirely in Tiles, to show what the editor puts out:

A map on a decay themeA map on a decay theme

Factory, an industrial complexFactory, an industrial complex

Factory, a multi-level platformFactory, a multi-level platform

Factory, an underground facilityFactory, an underground facility

Where it's going

Tiles is another one I'm planning to majorly overhaul, so consider this its current form. A proper rework is on the way.

Tech stack

LayerTechnologyRole
LanguageC++The editor and its renderer
GraphicsOpenGLThe batch 2D renderer everything draws through
UIDear ImGuiThe layer panel, brush controls, and atlas picker
FrameworkMy own built-in app frameworkWindowing and the app shell, Walnut-inspired
BuildVisual Studio (Windows)Where it compiles and runs