Skip to content

@icon does not work unless class_name is specified #65203

@RedMser

Description

@RedMser

Godot version

4.0.dev (728785d)

System information

Windows 10

Issue description

If you specify only @icon, it does not work. You must add class_name to your script for the icon to show up.

This is unlike the documentation which states:

Add a custom icon to the current script. The icon is displayed in the Scene dock for every node that the script is attached to. For named classes the icon is also displayed in various editor dialogs.

Steps to reproduce

  • Create an icon
  • Create a node with a script
  • Add @icon("res://icon.svg") to the script
  • Reload project (since this does not seem to live reload), icon does not show up
  • Add class_name Something to the script
  • Reload project again, icon now shows up

Minimal reproduction project

icon_annotation.zip

Icon will only show up if you add class_name Something to the script and then reload project.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions