godot-rust/gdext

Export properties

Bromeon opened this issue · 2 comments

Allow a way to export Rust fields as GDScript properties, e.g.:

#[export]
my_field: i32,

This tracks the basic feature, all the customization around GDScript's @export can come later.

Until this is implemented, #[func] functions can serve as a workaround to pass data back and forth.

It was suggested that, for cases where there's no actual need for a member variable to back a property, we can define a 0-byte type Property<T> like in GDNative that just provides the type.

This is done. Any further improvements can be tracked in separate issues.