You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An implementation of the rust programing language as a scripting language for the godot engine based on [godot-rust/gdext](https://github.com/godot-rust/gdext).
2
+
An implementation of the rust programing language as a scripting language for the godot 4.x engine based on [godot-rust/gdext](https://github.com/godot-rust/gdext).
3
3
4
4
# Important Notice
5
5
6
-
**godot-rust-script is still very experimental and unstable.**
6
+
**godot-rust-script is still experimental and undergoes breaking changes from time to time.**
7
7
8
-
This project also currently depends on a slightly modfied fork of [godot-rust/gdext](https://github.com/godot-rust/gdext) and should not be used in combination with any other version.
8
+
# Why?
9
9
10
-
# Featues
11
-
- use rust as scripts similar to GDScript or CSharp
12
-
- hot reload your rust scripts in development mode
13
-
- use familiar godot annotations similar to GDScripts annotations for editor integration
10
+
The question of why this project exists might arise, and it's a good question. The [godot-rust/gdext](https://github.com/godot-rust/gdext)
11
+
project already implements excellent bindings with the engine and provides a good developer experience. If you are just looking to write code
12
+
for your Godot project in rust, you most likely are already well served with gdext and definitely do not **need** this library.
14
13
15
-
#Setup
14
+
## When would you want to use `godot-rust-script`?
16
15
17
-
godot-rust-script comes with two compontents. A script runtime and a library for writing godot script compatible rust structs. Both these components have to be set up.
16
+
GDExtension works by allowing dynamic libraries to define their own Godot classes, which inherit directly from an existing class. These
17
+
classes inherit all the functionality of their base classes. Nothing more, nothing less. Scripts, on the other hand, offer a bit more
18
+
flexibility. While they also define a base class, this is more like a minimally required interface. Scripts are attached to an instance of
19
+
an existing class. As long as the instance inherits the required base class, the script is compatible with it. This makes the scripts somewhat
20
+
more flexible and provides more compossibility than using plain class-based inheritance. It is up to you to decide if you need this
21
+
additional flexibility.
18
22
19
-
Two sepearte crates are required to make rust scripts work.
23
+
# Setup
20
24
21
-
## Runtime library
25
+
To use `godot-rust-script` first follow the basic setup instructions for `gdext`.
22
26
23
-
rs-runtime/Cargo.toml
27
+
## Add Dependency
24
28
25
-
```toml
26
-
[package]
27
-
name = "rs-runtime"
28
-
version = "0.1.0"
29
-
edition = "2021"
29
+
The project has to be added as a cargo dependency. At the moment, it is not available on crates.io since it is still under heavy development.
30
+
This library currently re-exports the `godot` crate, but adding the `godot` dependency as well is recommended, as this most likely will change in the future.
0 commit comments