godot-rust / godot-rust/gdext

Specify icon as part of class declaration

Open
#1,200 2 comments 5 reactions 0 assignees View on GitHub
c: register feature good first issue
Dominant language
Rust
Stars
5.2k
Forks
312
Avg merge
12h 59m
Merged PRs (30d)
9

Description

It's already possible to specify icons in the `.gdextension` file, see #277.

Since this is somewhat out-of-band and GDExtension [meanwhile supports](https://github.com/godotengine/godot/blob/591e70ff78c665ff11e1f21998d0e52fbc3f23c8/core/extension/gdextension_interface.h#L373) icons to be specified as part of class declaration, we could support this as well:
```rs
#[derive(GodotClass)]
#[class(icon = "res://path/to/icon.png")]
struct MyClass {}
```
Ideally this would also allow any `AsArg` expressions -- not just literals, but also constants or global functions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.