-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
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 Array
s 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