godot-rust/gdext

Specify icon as part of class declaration

Open

#1.200 geöffnet am 13. Juni 2025

Auf GitHub ansehen
 (2 Kommentare) (5 Reaktionen) (0 zugewiesene Personen)Rust (300 Forks)auto 404
c: registerfeaturegood first issue

Repository-Metriken

Stars
 (4.972 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

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

Since this is somewhat out-of-band and GDExtension meanwhile supports icons to be specified as part of class declaration, we could support this as well:

#[derive(GodotClass)]
#[class(icon = "res://path/to/icon.png")]
struct MyClass {}

Ideally this would also allow any AsArg<GString> expressions -- not just literals, but also constants or global functions.

Contributor Guide