Skip to content

Add example for exposing Rust types to GDScript, using derive macros and/or wrapper classes #605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #767
ghost opened this issue Sep 25, 2020 · 2 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Sep 25, 2020

This question is asked pretty frequently, so it's good to have something to point users to.

  • Exposing value types through FromVariant and ToVariant.
  • Exposing operations on those types, e.g. Eq, through helper methods on a auto-load script.
  • Exposing opaque types / types with behaviors through wrapper classes.
  • Factory auto-load to work around the constructor argument problem.
@ghost ghost added documentation c: examples Example projects labels Sep 25, 2020
@Bromeon
Copy link
Member

Bromeon commented Aug 1, 2021

Partially documented in https://godot-rust.github.io/book/rust-binding.html.
The points mentioned above (especially using a wrapper or auto-load script) still need documentation and/or an example.

@Bromeon Bromeon added this to the v0.10.1 milestone Nov 1, 2021
@Bromeon Bromeon modified the milestones: v0.10.1, v0.10.2 Jul 16, 2022
@Bromeon Bromeon modified the milestones: v0.10.2, v0.11.x Oct 1, 2022
@chitoyuu
Copy link
Contributor

Autoload singletons now seem to be documented here: https://godot-rust.github.io/book/gdnative/faq/code.html#can-i-implement-static-methods-in-gdnative

Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants