godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.94k stars 3.22k forks source link

Place notes about Doubles in methods for C# users #7975

Open a2937 opened 1 year ago

a2937 commented 1 year ago

Your Godot version:4.1-Mono

Issue description: In the Method declaration, float is the type listed for the type of delta for both the _process and _physics_process method. I discovered the issue when writing C# code for the _Process C# binding. It uses the type double for delta in the C# binding. I assumed they are of the same type at first glance. It wouldn't occur normally for me to click on float because I know what a float is. There should have been a note about this for C# users that wouldn't think about checking the documentation for the float type. Yes, while it does list in the documentation about floats; it's inconvenient.

URL to the documentation page: https://docs.godotengine.org/en/stable/classes/class_node.html#class-node-method-physics-process

If you know how to fix the issue you are reporting please consider opening a pull request. We provide a tutorial on using git here: https://docs.godotengine.org/en/stable/community/contributing/pr_workflow.html, writing documentation at https://docs.godotengine.org/en/stable/community/contributing/docs_writing_guidelines.html and contributing to the class reference here: https://docs.godotengine.org/en/stable/community/contributing/updating_the_class_reference.html

jynus commented 1 year ago

While I am not sure it should be on every method (technically, the reference is not wrong), there should be a mention at https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_differences.html#doc-c-sharp-differences at least (I've not found one), as it can be confusing.

jynus commented 1 year ago

I've added what I think is a reasonable amend of the API differences between GDScript and C# manual, which I would recommend every C# developer to read. (I no longer thing it is the way to go, see below)

jynus commented 1 year ago

After discussing this, there is already a mention (although in the context of Variant) in the manual at https://docs.godotengine.org/en/stable/tutorials/scripting/c_sharp/c_sharp_variant.html so, while I think there should be in the future C#-specific documentation (with the C# types for each engine call), I don't think there is much else to do for now.

a2937 commented 1 year ago

That's valid. But I think sometime in the near future, maybe the documentation can be a little more explicit with the changes in the API between the two languages. Like having it side by side may be useful?