Projects: Tools and integrations

This page lists projects, which are intended to be used as an extension to godot-rust.
Examples include:

  • CLI or other tools enhancing the development workflow
  • Libraries that directly enhance the godot-rust experience
  • Libraries that connect godot-rust with other crates in the Rust ecosystem

This page should only provide a high-level description of each project (a couple sentences), plus relevant links and optionally one screenshot. It should not include tutorials or extended code examples, as they tend to become outdated very quickly. Instead, the project's repository or homepage is a much better place for advertising the concrete functionality the tool offers and providing introductory examples.

Table of contents

godot-egui

GitHub

godot-egui is an egui backend for godot-rust.

This crate enables using the immediate-mode UI library egui within Godot applications and games. Updating UI widgets and properties directly from Rust code becomes straightforward, without going through Godot nodes, signals and the intricacies of GDNative's ownership semantics.

godot-rust-cli

GitHub

Godot Rust CLI is a simple command-line interface to help you create and update Rust components for your Godot projects.

Example:

# create a Rust library `rust_modules` for the `platformer` Godot project
godot-rust-cli new rust_modules platformer

# create player.rs + player.gdns
godot-rust-cli create Player 

# generate dynamic library to be called by Godot, automatically watch changes
godot-rust-cli build --watch

Note that there is also godot-rust-cli-upgrader to upgrade the CLI.

bevy-godot

GitHub

bevy-godot is an in-development crate for using Bevy with the Godot Engine.

#![allow(unused)]
fn main() {
use bevy_godot::prelude::*;

fn init(_handle: &InitHandle) {}
fn build_app(app: &mut App) {
    app.add_startup_system(spawn_cube).add_system(move_cube);
}

bevy_godot_init!(init, build_app);

#[derive(Component)]
pub struct Cube {
    starting_position: Vector2,
}

fn spawn_cube(mut commands: Commands) {
    let starting_position = Vector2::new(500.0, 300.0);
    commands
        .spawn()
        .insert(GodotScene::from_path("res://simple_scene.tscn"))
        .insert(Cube { starting_position })
        .insert(Transform2D::from(
            GodotTransform2D::from_scale_rotation_origin(Vector2::ONE, 0.0, starting_position),
        ));
}

fn move_cube(mut cube: Query<(&Cube, &mut Transform2D)>, time: Res<Time>) {
    let (cube, mut transform) = cube.single_mut();
    transform.origin =
        Vector2::RIGHT * 300.0 * time.seconds_since_startup().sin() as f32 + cube.starting_position;
}
}

ftw

GitHub

ftw is a command-line interface to manage your godot-rust project. It enables you to set up projects, add native classes which are automatically wired up, and run build commands.

Example:

# create new project using the default template
ftw new my-awesome-game

# create a class that derives from `Area2D`
ftw class MyHero Area2D

# create a class called `MySingleton` that derives from `Node`
ftw singleton MySingleton
 
# build the library for the `linux-x86_64` platform using `debug` as default
ftw build linux-x86_64

gdrust

GitHub

gdrust is a an extension library to godot-rust. It adds ergonomic improvements and is an inspiration for godot-rust itself.

Example:

#[gdrust]
#[signal(signal_name(arg_name: I64, arg2_name: F64 = 10.0))]
struct MyClass {
    #[export_range(1, 10, 2, "or_greater")]
    my_range: i32,
}