mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
Change remaining "export" to "@export"
This PR changes the "export"s in the Array section of the GDScript Exports documentation to the "@export" annotation to be in line with 4.0. Also slightly touches up the wording when referring to default null assignment and Packed*Arrays.
This commit is contained in:
@@ -262,37 +262,37 @@ Default value must be a constant expression.
|
||||
|
||||
::
|
||||
|
||||
export var a = [1, 2, 3]
|
||||
@export var a = [1, 2, 3]
|
||||
|
||||
Exported arrays can specify type (using the same hints as before).
|
||||
|
||||
::
|
||||
|
||||
export(Array, int) var ints = [1, 2, 3]
|
||||
export(Array, int, "Red", "Green", "Blue") var enums = [2, 1, 0]
|
||||
export(Array, Array, float) var two_dimensional = [[1.0, 2.0], [3.0, 4.0]]
|
||||
@export(Array, int) var ints = [1, 2, 3]
|
||||
@export(Array, int, "Red", "Green", "Blue") var enums = [2, 1, 0]
|
||||
@export(Array, Array, float) var two_dimensional = [[1.0, 2.0], [3.0, 4.0]]
|
||||
|
||||
You can omit the default value, but then it would be null if not assigned.
|
||||
You can omit the default value, but it would then be ``null`` if not assigned.
|
||||
|
||||
::
|
||||
|
||||
export(Array) var b
|
||||
export(Array, PackedScene) var scenes
|
||||
@export(Array) var b
|
||||
@export(Array, PackedScene) var scenes
|
||||
|
||||
Arrays with specified types which inherit from resource can be set by
|
||||
drag-and-dropping multiple files from the FileSystem dock.
|
||||
|
||||
::
|
||||
|
||||
export(Array, Texture) var textures
|
||||
export(Array, PackedScene) var scenes
|
||||
@export(Array, Texture) var textures
|
||||
@export(Array, PackedScene) var scenes
|
||||
|
||||
Typed arrays also work, only initialized empty:
|
||||
Packed type arrays also work, but only initialized empty:
|
||||
|
||||
::
|
||||
|
||||
export var vector3s = PackedVector3Array()
|
||||
export var strings = PackedStringArray()
|
||||
@export var vector3s = PackedVector3Array()
|
||||
@export var strings = PackedStringArray()
|
||||
|
||||
Default value can include run-time values, but can't
|
||||
be exported.
|
||||
|
||||
Reference in New Issue
Block a user