gdext
gdext copied to clipboard
Rust bindings for Godot 4
See also #282. Apparently the editor allows `null` values in arrays in all cases. I did not check if this is an array-specific thing. gdext Version: 8990464 (master) How to...
Following up from discord that Gd::try_cast can cast to any derived class. Both `Player` and `Enemy` inherits from `CharacterBody3D` and can be seen and selected from Godot engine editor. Player...
it seems like it should be possible to create a form of `GodotStr` something like: ```rs #[repr(transparent)] pub struct GodotStr { data: [u32] } ``` That is to `GodotString` as...
In addition to Rust APIs, users may benefit from simple building blocks in GDScript. On [Discord](https://discord.com/channels/723850269347283004/1043514894198255737/1115498782210150460), one idea that came up was mapping `Result` to GDScript, that would allow accessing...
Using this code: ```rs use godot::prelude::*; #[derive(GodotClass)] #[class(init, base=Node)] pub struct Mini { #[base] base: Base, } #[godot_api] impl Mini { #[func] fn bar(&self) { panic!("error") } } struct Testing;...
Create a class like this: ```rs #[derive(GodotClass)] #[class(init)] pub struct Mini {} #[godot_api] impl Mini { #[func] fn foo(&self) -> i64 { 20 } #[func] fn bar(&self) {} } ```...
It should be possible to implement `Future` for signals, and add support for `async` functions in exported methods, with them returning a signal. These two things combined should allow us...
https://user-images.githubusercontent.com/70787919/236376594-bf89d94a-8ed9-4c68-9e17-3ba4ff0cf95d.mp4 `NEAT` is a rust class extending `RefCounted`, and the doc page is just empty. Godot version [`8c729f0f3`](https://github.com/godotengine/godot/commit/8c729f0f3)
```rust #[derive(GodotClass)] #[class] pub struct World { } #[derive(GodotClass)] #[class(init)] pub struct WorldGen { } #[godot_api] impl WorldGen { #[func] fn generate(&mut self) -> Gd { Gd::new(World {}) } }...
### This feature aims to mimic GDScript's `@onready` annotation in a more ergonomic way. It still uses the type `OnReady`, but the initialization closure now accepts an argument of type...