godot-rust/gdext

Specify icon as part of class declaration

Open

#1,200 opened on Jun 13, 2025

View on GitHub
 (2 comments) (5 reactions) (0 assignees)Rust (300 forks)auto 404
c: registerfeaturegood first issue

Repository metrics

Stars
 (4,972 stars)
PR merge metrics
 (PR metrics pending)

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 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