diff options
author | Abel Toy <abeltoy@hey.com> | 2023-10-07 19:32:08 +0900 |
---|---|---|
committer | Abel Toy <abeltoy@hey.com> | 2024-03-06 16:17:54 +0900 |
commit | 882441a0ad00fed66bf5d0859e36e7f369d9d509 (patch) | |
tree | 4ba0feb24ecf6fb99b91126f4328ed56a7f779ed /modules/gdscript/doc_classes | |
parent | f2045ba822bff7d34964901393581a3117c394a9 (diff) | |
download | redot-engine-882441a0ad00fed66bf5d0859e36e7f369d9d509.tar.gz |
Support Array and PackedArray in @export_*
Diffstat (limited to 'modules/gdscript/doc_classes')
-rw-r--r-- | modules/gdscript/doc_classes/@GDScript.xml | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index 7ececce613..ddf506216e 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -333,20 +333,22 @@ <annotation name="@export_color_no_alpha"> <return type="void" /> <description> - Export a [Color] property without allowing its transparency ([member Color.a]) to be edited. + Export a [Color], [Array][lb][Color][rb], or [PackedColorArray] property without allowing its transparency ([member Color.a]) to be edited. See also [constant PROPERTY_HINT_COLOR_NO_ALPHA]. [codeblock] @export_color_no_alpha var dye_color: Color + @export_color_no_alpha var dye_colors: Array[Color] [/codeblock] </description> </annotation> <annotation name="@export_dir"> <return type="void" /> <description> - Export a [String] property as a path to a directory. The path will be limited to the project folder and its subfolders. See [annotation @export_global_dir] to allow picking from the entire filesystem. + Export a [String], [Array][lb][String][rb], or [PackedStringArray] property as a path to a directory. The path will be limited to the project folder and its subfolders. See [annotation @export_global_dir] to allow picking from the entire filesystem. See also [constant PROPERTY_HINT_DIR]. [codeblock] @export_dir var sprite_folder_path: String + @export_dir var sprite_folder_paths: Array[String] [/codeblock] </description> </annotation> @@ -354,12 +356,15 @@ <return type="void" /> <param index="0" name="names" type="String" /> <description> - Export an [int] or [String] property as an enumerated list of options. If the property is an [int], then the index of the value is stored, in the same order the values are provided. You can add explicit values using a colon. If the property is a [String], then the value is stored. + Export an [int], [String], [Array][lb][int][rb], [Array][lb][String][rb], [PackedByteArray], [PackedInt32Array], [PackedInt64Array], or [PackedStringArray] property as an enumerated list of options (or an array of options). If the property is an [int], then the index of the value is stored, in the same order the values are provided. You can add explicit values using a colon. If the property is a [String], then the value is stored. See also [constant PROPERTY_HINT_ENUM]. [codeblock] @export_enum("Warrior", "Magician", "Thief") var character_class: int @export_enum("Slow:30", "Average:60", "Very Fast:200") var character_speed: int @export_enum("Rebecca", "Mary", "Leah") var character_name: String + + @export_enum("Sword", "Spear", "Mace") var character_items: Array[int] + @export_enum("double_jump", "climb", "dash") var character_skills: Array[String] [/codeblock] If you want to set an initial value, you must specify it explicitly: [codeblock] @@ -369,6 +374,9 @@ [codeblock] enum CharacterName {REBECCA, MARY, LEAH} @export var character_name: CharacterName + + enum CharacterItem {SWORD, SPEAR, MACE} + @export var character_items: Array[CharacterItem] [/codeblock] </description> </annotation> @@ -382,6 +390,7 @@ @export_exp_easing var transition_speed @export_exp_easing("attenuation") var fading_attenuation @export_exp_easing("positive_only") var effect_power + @export_exp_easing var speeds: Array[float] [/codeblock] </description> </annotation> @@ -389,12 +398,13 @@ <return type="void" /> <param index="0" name="filter" type="String" default="""" /> <description> - Export a [String] property as a path to a file. The path will be limited to the project folder and its subfolders. See [annotation @export_global_file] to allow picking from the entire filesystem. + Export a [String], [Array][lb][String][rb], or [PackedStringArray] property as a path to a file. The path will be limited to the project folder and its subfolders. See [annotation @export_global_file] to allow picking from the entire filesystem. If [param filter] is provided, only matching files will be available for picking. See also [constant PROPERTY_HINT_FILE]. [codeblock] @export_file var sound_effect_path: String @export_file("*.txt") var notes_path: String + @export_file var level_paths: Array[String] [/codeblock] </description> </annotation> @@ -421,6 +431,10 @@ [codeblock] @export_flags("A:16", "B", "C") var x [/codeblock] + You can also use the annotation on [Array][lb][int][rb], [PackedByteArray], [PackedInt32Array], and [PackedInt64Array] + [codeblock] + @export_flags("Fire", "Water", "Earth", "Wind") var phase_elements: Array[int] + [/codeblock] </description> </annotation> <annotation name="@export_flags_2d_navigation"> @@ -430,6 +444,7 @@ See also [constant PROPERTY_HINT_LAYERS_2D_NAVIGATION]. [codeblock] @export_flags_2d_navigation var navigation_layers: int + @export_flags_2d_navigation var navigation_layers_array: Array[int] [/codeblock] </description> </annotation> @@ -440,6 +455,7 @@ See also [constant PROPERTY_HINT_LAYERS_2D_PHYSICS]. [codeblock] @export_flags_2d_physics var physics_layers: int + @export_flags_2d_physics var physics_layers_array: Array[int] [/codeblock] </description> </annotation> @@ -450,6 +466,7 @@ See also [constant PROPERTY_HINT_LAYERS_2D_RENDER]. [codeblock] @export_flags_2d_render var render_layers: int + @export_flags_2d_render var render_layers_array: Array[int] [/codeblock] </description> </annotation> @@ -460,6 +477,7 @@ See also [constant PROPERTY_HINT_LAYERS_3D_NAVIGATION]. [codeblock] @export_flags_3d_navigation var navigation_layers: int + @export_flags_3d_navigation var navigation_layers_array: Array[int] [/codeblock] </description> </annotation> @@ -470,6 +488,7 @@ See also [constant PROPERTY_HINT_LAYERS_3D_PHYSICS]. [codeblock] @export_flags_3d_physics var physics_layers: int + @export_flags_3d_physics var physics_layers_array: Array[int] [/codeblock] </description> </annotation> @@ -480,6 +499,7 @@ See also [constant PROPERTY_HINT_LAYERS_3D_RENDER]. [codeblock] @export_flags_3d_render var render_layers: int + @export_flags_3d_render var render_layers_array: Array[int] [/codeblock] </description> </annotation> @@ -490,16 +510,18 @@ See also [constant PROPERTY_HINT_LAYERS_AVOIDANCE]. [codeblock] @export_flags_avoidance var avoidance_layers: int + @export_flags_avoidance var avoidance_layers_array: Array[int] [/codeblock] </description> </annotation> <annotation name="@export_global_dir"> <return type="void" /> <description> - Export a [String] property as an absolute path to a directory. The path can be picked from the entire filesystem. See [annotation @export_dir] to limit it to the project folder and its subfolders. + Export a [String], [Array][lb][String][rb], or [PackedStringArray] property as an absolute path to a directory. The path can be picked from the entire filesystem. See [annotation @export_dir] to limit it to the project folder and its subfolders. See also [constant PROPERTY_HINT_GLOBAL_DIR]. [codeblock] @export_global_dir var sprite_folder_path: String + @export_global_dir var sprite_folder_paths: Array[String] [/codeblock] </description> </annotation> @@ -507,12 +529,13 @@ <return type="void" /> <param index="0" name="filter" type="String" default="""" /> <description> - Export a [String] property as an absolute path to a file. The path can be picked from the entire filesystem. See [annotation @export_file] to limit it to the project folder and its subfolders. + Export a [String], [Array][lb][String][rb], or [PackedStringArray] property as an absolute path to a file. The path can be picked from the entire filesystem. See [annotation @export_file] to limit it to the project folder and its subfolders. If [param filter] is provided, only matching files will be available for picking. See also [constant PROPERTY_HINT_GLOBAL_FILE]. [codeblock] @export_global_file var sound_effect_path: String @export_global_file("*.txt") var notes_path: String + @export_global_file var multiple_paths: Array[String] [/codeblock] </description> </annotation> @@ -542,10 +565,11 @@ <annotation name="@export_multiline"> <return type="void" /> <description> - Export a [String] property with a large [TextEdit] widget instead of a [LineEdit]. This adds support for multiline content and makes it easier to edit large amount of text stored in the property. + Export a [String], [Array][lb][String][rb], [PackedStringArray], [Dictionary] or [Array][lb][Dictionary][rb] property with a large [TextEdit] widget instead of a [LineEdit]. This adds support for multiline content and makes it easier to edit large amount of text stored in the property. See also [constant PROPERTY_HINT_MULTILINE_TEXT]. [codeblock] @export_multiline var character_biography + @export_multiline var npc_dialogs: Array[String] [/codeblock] </description> </annotation> @@ -553,10 +577,11 @@ <return type="void" /> <param index="0" name="type" type="String" default="""" /> <description> - Export a [NodePath] property with a filter for allowed node types. + Export a [NodePath] or [Array][lb][NodePath][rb] property with a filter for allowed node types. See also [constant PROPERTY_HINT_NODE_PATH_VALID_TYPES]. [codeblock] @export_node_path("Button", "TouchScreenButton") var some_button + @export_node_path("Button", "TouchScreenButton") var many_buttons: Array[NodePath] [/codeblock] [b]Note:[/b] The type must be a native class or a globally registered script (using the [code]class_name[/code] keyword) that inherits [Node]. </description> @@ -565,10 +590,11 @@ <return type="void" /> <param index="0" name="placeholder" type="String" /> <description> - Export a [String] property with a placeholder text displayed in the editor widget when no value is present. + Export a [String], [Array][lb][String][rb], or [PackedStringArray] property with a placeholder text displayed in the editor widget when no value is present. See also [constant PROPERTY_HINT_PLACEHOLDER_TEXT]. [codeblock] @export_placeholder("Name in lowercase") var character_id: String + @export_placeholder("Name in lowercase") var friend_ids: Array[String] [/codeblock] </description> </annotation> @@ -579,7 +605,7 @@ <param index="2" name="step" type="float" default="1.0" /> <param index="3" name="extra_hints" type="String" default="""" /> <description> - Export an [int] or [float] property as a range value. The range must be defined by [param min] and [param max], as well as an optional [param step] and a variety of extra hints. The [param step] defaults to [code]1[/code] for integer properties. For floating-point numbers this value depends on your [member EditorSettings.interface/inspector/default_float_step] setting. + Export an [int], [float], [Array][lb][int][rb], [Array][lb][float][rb], [PackedByteArray], [PackedInt32Array], [PackedInt64Array], [PackedFloat32Array], or [PackedFloat64Array] property as a range value. The range must be defined by [param min] and [param max], as well as an optional [param step] and a variety of extra hints. The [param step] defaults to [code]1[/code] for integer properties. For floating-point numbers this value depends on your [member EditorSettings.interface/inspector/default_float_step] setting. If hints [code]"or_greater"[/code] and [code]"or_less"[/code] are provided, the editor widget will not cap the value at range boundaries. The [code]"exp"[/code] hint will make the edited values on range to change exponentially. The [code]"hide_slider"[/code] hint will hide the slider element of the editor widget. Hints also allow to indicate the units for the edited value. Using [code]"radians_as_degrees"[/code] you can specify that the actual value is in radians, but should be displayed in degrees in the Inspector dock (the range values are also in degrees). [code]"degrees"[/code] allows to add a degree sign as a unit suffix (the value is unchanged). Finally, a custom suffix can be provided using [code]"suffix:unit"[/code], where "unit" can be any string. See also [constant PROPERTY_HINT_RANGE]. @@ -587,6 +613,7 @@ @export_range(0, 20) var number @export_range(-10, 20) var number @export_range(-10, 20, 0.2) var number: float + @export_range(0, 20) var numbers: Array[float] @export_range(0, 100, 1, "or_greater") var power_percent @export_range(0, 100, 1, "or_greater", "or_less") var health_delta |