-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Added a hint for the C# constants use #70852
Conversation
Instead of Color.RED (GDScript), constants are found under the Colors class
The same is true for any constant AFAIK, and we don't typically document all differences between the native Godot API and the C# glue case conversions in the class reference. Doing this consistently would lead to a lot of extra work, and doing it only here would be inconsistent. The difference in the constant casing for C# is documented here: https://docs.godotengine.org/en/latest/tutorials/scripting/c_sharp/c_sharp_differences.html#constants As a side note, the cheat sheet picture should be redone to use the |
@akien-mga I understand. I struggled more than I should to find the C# enum-class equivalent so I wanted to make the life easier for people who might have the same issue in the future, and while I was looking at the Color doc I didn't see any mention of the Colors C# class -- althought there is one but below the description, for something that has nothing to do at first sight. |
I guess there are two issues here. First, constants use different writing style between the engine/GDScript and C#. That is documented at the link, and there is nothing special in that regard for color constants. Second, apparently in C# you should use Colors, with an "s" at the end, instead of Color. That might need a dedicated mention in the linked doc (and would also be a fair game for the class description, IMO). Note that I don't know if this is true or not in the first place, I trust that you've tested it. |
Indeed, if C# constants are in a separate |
I think the C# API differences to GDScript page is a bit outdated and is missing some differences. I wanted to add a section for the However, I feel like that page is often missed by users, specially if you are new you probably won't think to look for it so I'd be in favor of adding links to it from the class reference. |
Do you have any idea on how to better address this? Should we add a reference to it at the top of the editor help if you're using a "mono" version? |
That's a good idea. Maybe there should be a dedicated first section about using the class reference for C# users, explaining the general concepts first before going into details. The current page kind of does that but without the perspective of a class reference reader specifically, I think it would be a useful angle to develop. |
Thanks for your contribution! #79206 supersedes this PR, but I hope you'll be able to contribute something else in the future! |
Instead of Color.RED (GDScript), constants are found under the Colors class