defold-rs

defold-rs

Crates.io

Tools for creating Defold native extensions in Rust.

Quick Start

You will need: - Defold - Docker - The template project - The extension build server

Follow the instructions in the build server's README to get it built and running. Once it's up, open the template project in Defold and open /myextension/src in a Rust-compatible IDE. To tell Defold to use your build server, select File > Preferences > Extensions and set Build Server to http://localhost:9000. Once that's done, you can just press Ctrl+B in Defold to begin compiling your project! The first build will take some time while it downloads files from Defold's servers and compiles the crate from scratch.

What is Defold?

Defold is a free and open-source game engine focused on making fast, lightweight games for desktop, web, mobile, and console with zero setup. Almost all game logic is written in Lua scripts, but the engine also provides a way to extend its functionality with C++ using native extensions.

What are native extensions?

Native extensions allow you to extend Defold's functionality using C++ or any platform-specific language. You can write extensions in JavaScript for web games, Java for Android, or Objective-C for macOS/iOS. Defold's extension SDK (dmSDK for short) grants you much deeper control of the engine than standard Lua scripts and is great for performance-sensitive processing.

So what's defold-rs then?

It's two main pieces that come together to let you write native extensions in Rust: