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

Add mentions of export_custom to GDScript exports tutorial #9925

Open
Agecaf opened this issue Sep 8, 2024 · 0 comments
Open

Add mentions of export_custom to GDScript exports tutorial #9925

Agecaf opened this issue Sep 8, 2024 · 0 comments
Labels
area:manual Issues and PRs related to the Manual/Tutorials section of the documentation enhancement

Comments

@Agecaf
Copy link

Agecaf commented Sep 8, 2024

Your Godot version: 4.3

Issue description:

In the GDscript exported properties page there is no mention of @export_custom. I think users interested in exported properties should at least be pointed out to its existence so that they can explore all the useful built-in property hints that are available.

For example, I was looking for a way to make a multiline string input that uses a monospace font, and spent a long time looking for such an option, I then even considered creating an EditorInspectorPlugin to add this functionality... And that's when I learn that @export_custom(PROPERTY_HINT_EXPRESSION, "") not only uses a monospace font but also highlights it which is exactly what I was looking for.

While I think it's enough to point users towards exploring the rest of the documentation on their own, I think there's a couple of export_custom variations that would be nice to have in the GDScipt exported properties tutorial, like the hint expression and hint link.

One last thing, in the GDScript exported properties tutorial, it says that

# Nested typed arrays such as `Array[Array[float]]` are not supported yet.
@export var two_dimensional: Array[Array] = [[1.0, 2.0], [3.0, 4.0]]

Which, while Array[Array[float]] is not supported in GDScript at the moment, it seems to be supported as an inspector property with PROPERTY_HINT_TYPE_STRING as seen here, with a working example here:

@export_custom(PROPERTY_HINT_TYPE_STRING,"28:3:")
var array_of_array_of_floats: Array

So, while I think it's useful to remind users that Array[Array[float]] types are not yet supported internally by Godot, it would still be useful to let them know how they can use property type hints to make the editor's inspector make their Arrays behave like Array[Array[float]], as this can ensure values entered in the Inspector are of the right type.

URL to the documentation page (if already existing):
GDScript exported properties
https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_exports.html

@skyace65 skyace65 added the area:manual Issues and PRs related to the Manual/Tutorials section of the documentation label Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:manual Issues and PRs related to the Manual/Tutorials section of the documentation enhancement
Projects
None yet
Development

No branches or pull requests

2 participants