Skip to content

About

A visual layout and animation editor for Moth UI — design 2D interfaces with Flash-style keyframe animation, real-time canvas preview, and a property inspector. Built with Dear ImGui on moth_toolkit.

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Moth Editor

Build Tests Release License: MIT

A visual layout and animation editor for moth::ui. Design UI layouts and keyframe animations in a Flash-like authoring environment, then load them directly into your moth::ui application at runtime.

The editor is a separate application, not a toolkit one: it depends on the toolkit's modules but is not built as part of it.

Editor Screenshot


Table of Contents


Features

Layout editing: place and arrange UI elements on a canvas with mouse-driven move and resize controls. Elements can be anchored to parent edges or corners so layouts adapt cleanly across different resolutions without manual adjustment.

Keyframe animation: animate any property over time using a timeline editor. Keyframes can be added, moved, and deleted per property, and multiple named clips can be defined within a single layout for things like idle, hover, and transition states.

Animation events: attach named events to specific frames on the timeline. These fire as callbacks in the running application, making it easy to synchronise sound, logic, or state changes to an animation without hard-coding timings.

Live preview: play back animations inside the editor at runtime speed to see exactly how they will look in the application before exporting.

Texture packing: pack all images referenced by a layout into texture atlases in one step, reducing draw calls and load times in the runtime application.

Autosave: automatically save the current layout on a configurable interval. Keeps a configurable number of versioned copies and only runs when there are unsaved changes.

Crash recovery: a recovery snapshot is written on every edit when there are unsaved changes. If the editor exits unexpectedly, the snapshot is detected on the next launch and you are prompted to restore or discard it.

AI Disclosure

AI agents (primarily Claude) are used as tools in this project for tasks such as refactoring, documentation writing, and test implementation. The architecture, design decisions, and direction of the project are human-driven. This is not a vibe-coded project.


Building

Pre-built binaries for Windows and Linux are attached to each GitHub Release if you'd rather not build from source.

Prerequisites

Set up a Python virtual environment and install Conan:

# Linux / macOS
python3 -m venv .venv
source .venv/bin/activate
pip install conan

# Windows (PowerShell)
python3 -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install conan

C++17 is required. The recipe checks for it. On Linux, Conan's detected profile already uses gnu17. On Windows, MSVC's detected profile defaults to C++14, so pass -s compiler.cppstd=17 or set it in your Conan profile.

moth_editor depends on the moth_toolkit modules moth_core, moth_ui, moth_graphics, moth_bridge, and moth_packer, which are published to an Artifactory remote rather than Conan Center. Register the remote once before installing (it is publicly readable, so no login is required):

conan remote add moth https://artifactory.matthewcotton.net/artifactory/api/conan/conan-local

Linux

Several system packages are required on Linux. GTK3 is needed by nativefiledialog; GLFW, FreeType, and HarfBuzz are pulled in transitively via moth_graphics (see the moth_toolkit README for background on why these must come from the system).

Conan installs these through apt when you allow it to manage system packages:

conan install . -s build_type=Release --build=missing \
    -c tools.system.package_manager:mode=install -c tools.system.package_manager:sudo=True
cmake --preset conan-release
cmake --build --preset conan-release

If you'd rather install them yourself first:

sudo apt install libgtk-3-dev libglfw3-dev libfreetype-dev libharfbuzz-dev

Windows

conan install . -s compiler.cppstd=17 -s build_type=Release --build=missing
cmake --preset conan-default
cmake --build --preset conan-release

Related Projects

Project Description
moth_toolkit The modular 2D engine toolkit this editor builds against
moth::ui Core UI library: node graph, keyframe animation, and event system
moth::gfx Vulkan-backed 2D renderer, window management, and the platform bootstrap
moth::bridge Adapts moth::ui onto moth::gfx and provides the application loop
moth::packer Texture atlas and flipbook sheet packing
moth_editor (this project) Visual layout and animation editor for creating moth::ui layout files

License

MIT. See LICENSE.

About

A visual layout and animation editor for Moth UI — design 2D interfaces with Flash-style keyframe animation, real-time canvas preview, and a property inspector. Built with Dear ImGui on moth_toolkit.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages