Skip to content
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

Allow class_name to also add a description #23047

Closed
xDGameStudios opened this issue Oct 16, 2018 · 5 comments
Closed

Allow class_name to also add a description #23047

xDGameStudios opened this issue Oct 16, 2018 · 5 comments

Comments

@xDGameStudios
Copy link
Contributor

Godot version:
3.1.alpha.calinou.4c1a5d9

OS/device including version:
OSX High Sierra

Issue description:
Not really and issue just a "request"!! to my knowledge there is no way of adding a description to a class or resource when using class_name (keyword). It is possible to add an icon but no description, that would be a good (and simple, I think) addition.

@Zylann
Copy link
Contributor

Zylann commented Oct 16, 2018

This could be related to #6204 and #20318 in the sense of providing metadata to the editor for scripts and their contents, and IMO it's part of the (actually many) little "meta" things people have been requesting to script classes and members.

@willnationsdev
Copy link
Contributor

Yeah, I agree. This is a job for annotations (and really, the custom icon should be too, possibly even the class_name keyword itself as well).

@Chaosus Chaosus added this to the 3.2 milestone Oct 16, 2018
@akien-mga akien-mga removed this from the 3.2 milestone Oct 28, 2019
@akien-mga akien-mga changed the title Allow class_name to also add a description!! Allow class_name to also add a description Oct 28, 2019
@Xrayez
Copy link
Contributor

Xrayez commented Jun 24, 2020

Given the idea with annotations in GDScript 2.0 and implemented node descriptions in #31389, is this feature redundant?

@Calinou
Copy link
Member

Calinou commented Jun 25, 2020

@Xrayez Not completely, as we'd like the description to show up in the Create New Node dialog.

Since implementing godotengine/godot-proposals#177 or another documentation generation proposal would address this, I'll close this issue.

@idbrii
Copy link
Contributor

idbrii commented Dec 21, 2024

Summary of solution for future searchers:

Class doc strings are supported in Godot 4 (d1231be). Put the comment after class_name + extends:

class_name DirectoryResource
extends Resource
## A resource that loads all of the files in a directory.

Image

(Caveat: Changes to this doc comment often don't update until I restart the editor.)

If you put it before class_name but have other ## comments, they might override the doc comment:

## Force the global rotation to stay at 100.
class_name NilRotation
extends Node2D


## Run every frame. (Oops, this becomes the class doc string.)

func _process(_dt):
    global_rotation = 0

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

No branches or pull requests

8 participants