Skip to content

Type-safe signals from Godot-defined structs #1108

Closed
@atollk

Description

@atollk

I just saw that type-safe signals have recently been added to godot-rust, including a chapter in the book. That chapter solely focuses on signals defined in custom classes. Is there a way to use signals defined by the Godot library in types like Node in a type-safe way? Is this still work in progress (considering it's just on the master branch, not a released version)?

#[godot_api]
impl IArea2D for Player {
    fn ready(&mut self) {
        self.base().signals().body_entered().connect(/* ... */);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: engineGodot classes (nodes, resources, ...)featureAdds functionality to the library

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions