1# If the exported value assigns a constant or constant expression,
2# the type will be inferred and used in the editor.
3
4export var number = 5
5
6# Export can take a basic data type as an argument, which will be
7# used in the editor.
8
9export(int) var number
10
11# Export can also take a resource type to use as a hint.
12
13export(Texture) var character_face
14export(PackedScene) var scene_file
15# There are many resource types that can be used this way, try e.g.
16# the following to list them:
17export(Resource) var resource
18
19# Integers and strings hint enumerated values.
20
21# Editor will enumerate as 0, 1 and 2.
22export(int, "Warrior", "Magician", "Thief") var character_class
23# Editor will enumerate with string names.
24export(String, "Rebecca", "Mary", "Leah") var character_name
25
26# Named enum values
27
28# Editor will enumerate as THING_1, THING_2, ANOTHER_THING.
29enum NamedEnum {THING_1, THING_2, ANOTHER_THING = -1}
30export(NamedEnum) var x
31
32# Strings as paths
33
34# String is a path to a file.
35export(String, FILE) var f
36# String is a path to a directory.
37export(String, DIR) var f
38# String is a path to a file, custom filter provided as hint.
39export(String, FILE, "*.txt") var f
40
41# Using paths in the global filesystem is also possible,
42# but only in scripts in "tool" mode.
43
44# String is a path to a PNG file in the global filesystem.
45export(String, FILE, GLOBAL, "*.png") var tool_image
46# String is a path to a directory in the global filesystem.
47export(String, DIR, GLOBAL) var tool_dir
48
49# The MULTILINE setting tells the editor to show a large input
50# field for editing over multiple lines.
51export(String, MULTILINE) var text
52
53# Limiting editor input ranges
54
55# Allow integer values from 0 to 20.
56export(int, 20) var i
57# Allow integer values from -10 to 20.
58export(int, -10, 20) var j
59# Allow floats from -10 to 20 and snap the value to multiples of 0.2.
60export(float, -10, 20, 0.2) var k
61# Allow values 'y = exp(x)' where 'y' varies between 100 and 1000
62# while snapping to steps of 20. The editor will present a
63# slider for easily editing the value.
64export(float, EXP, 100, 1000, 20) var l
65
66# Floats with easing hint
67
68# Display a visual representation of the 'ease()' function
69# when editing.
70export(float, EASE) var transition_speed
71
72# Colors
73
74# Color given as red-green-blue value (alpha will always be 1).
75export(Color, RGB) var col
76# Color given as red-green-blue-alpha value.
77export(Color, RGBA) var col
78
79# Nodes
80
81# Another node in the scene can be exported as a NodePath.
82export(NodePath) var node_path
83# Do take note that the node itself isn't being exported -
84# there is one more step to call the true node:
85var node = get_node(node_path)
86
87# Resources
88
89export(Resource) var resource
90# In the Inspector, you can then drag and drop a resource file
91# from the FileSystem dock into the variable slot.
92
93# Opening the inspector dropdown may result in an
94# extremely long list of possible classes to create, however.
95# Therefore, if you specify an extension of Resource such as:
96export(AnimationNode) var resource
97# The drop-down menu will be limited to AnimationNode and all
98# its inherited classes.
99
100
101
1#If the exported value assigns a constant or constant expression,
2# the type will be inferred and used in the editor.
3
4export var number = 5
5
6# Export can take a basic data type as an argument, which will be
7# used in the editor.
8
9export(int) var number
10
11# Export can also take a resource type to use as a hint.
12
13export(Texture) var character_face
14export(PackedScene) var scene_file
15# There are many resource types that can be used this way, try e.g.
16# the following to list them:
17export(Resource) var resource
18
19# Integers and strings hint enumerated values.
20
21# Editor will enumerate as 0, 1 and 2.
22export(int, "Warrior", "Magician", "Thief") var character_class
23# Editor will enumerate with string names.
24export(String, "Rebecca", "Mary", "Leah") var character_name
25
26# Named enum values
27
28# Editor will enumerate as THING_1, THING_2, ANOTHER_THING.
29enum NamedEnum {THING_1, THING_2, ANOTHER_THING = -1}
30export(NamedEnum) var x
31
32# Strings as paths
33
34# String is a path to a file.
35export(String, FILE) var f
36# String is a path to a directory.
37export(String, DIR) var f
38# String is a path to a file, custom filter provided as hint.
39export(String, FILE, "*.txt") var f
40
41# Using paths in the global filesystem is also possible,
42# but only in scripts in "tool" mode.
43
44# String is a path to a PNG file in the global filesystem.
45export(String, FILE, GLOBAL, "*.png") var tool_image
46# String is a path to a directory in the global filesystem.
47export(String, DIR, GLOBAL) var tool_dir
48
49# The MULTILINE setting tells the editor to show a large input
50# field for editing over multiple lines.
51export(String, MULTILINE) var text
52
53# Limiting editor input ranges
54
55# Allow integer values from 0 to 20.
56export(int, 20) var i
57# Allow integer values from -10 to 20.
58export(int, -10, 20) var j
59# Allow floats from -10 to 20 and snap the value to multiples of 0.2.
60export(float, -10, 20, 0.2) var k
61# Allow values 'y = exp(x)' where 'y' varies between 100 and 1000
62# while snapping to steps of 20. The editor will present a
63# slider for easily editing the value.
64export(float, EXP, 100, 1000, 20) var l
65
66# Floats with easing hint
67
68# Display a visual representation of the 'ease()' function
69# when editing.
70export(float, EASE) var transition_speed
71
72# Colors
73
74# Color given as red-green-blue value (alpha will always be 1).
75export(Color, RGB) var col
76# Color given as red-green-blue-alpha value.
77export(Color, RGBA) var col
78
79# Nodes
80
81# Another node in the scene can be exported as a NodePath.
82export(NodePath) var node_path
83# Do take note that the node itself isn't being exported -
84# there is one more step to call the true node:
85var node = get_node(node_path)
86
87# Resources
88
89export(Resource) var resource
90# In the Inspector, you can then drag and drop a resource file
91# from the FileSystem dock into the variable slot.
92
93# Opening the inspector dropdown may result in an
94# extremely long list of possible classes to create, however.
95# Therefore, if you specify an extension of Resource such as:
96export(AnimationNode) var resource
97# The drop-down menu will be limited to AnimationNode and all
98# its inherited classes.
1# If the exported value assigns a constant or constant expression,
2# the type will be inferred and used in the editor.
3
4export var number = 5
5
6# Export can take a basic data type as an argument, which will be
7# used in the editor.
8
9export(int) var number
10
11# Export can also take a resource type to use as a hint.
12
13export(Texture) var character_face
14export(PackedScene) var scene_file
15# There are many resource types that can be used this way, try e.g.
16# the following to list them:
17export(Resource) var resource
18
19# Integers and strings hint enumerated values.
20
21# Editor will enumerate as 0, 1 and 2.
22export(int, "Warrior", "Magician", "Thief") var character_class
23# Editor will enumerate with string names.
24export(String, "Rebecca", "Mary", "Leah") var character_name
25
26# Named enum values
27
28# Editor will enumerate as THING_1, THING_2, ANOTHER_THING.
29enum NamedEnum {THING_1, THING_2, ANOTHER_THING = -1}
30export(NamedEnum) var x
31
32# Strings as paths
33
34# String is a path to a file.
35export(String, FILE) var f
36# String is a path to a directory.
37export(String, DIR) var f
38# String is a path to a file, custom filter provided as hint.
39export(String, FILE, "*.txt") var f
40
41# Using paths in the global filesystem is also possible,
42# but only in scripts in "tool" mode.
43
44# String is a path to a PNG file in the global filesystem.
45export(String, FILE, GLOBAL, "*.png") var tool_image
46# String is a path to a directory in the global filesystem.
47export(String, DIR, GLOBAL) var tool_dir
48
49# The MULTILINE setting tells the editor to show a large input
50# field for editing over multiple lines.
51export(String, MULTILINE) var text
52
53# Limiting editor input ranges
54
55# Allow integer values from 0 to 20.
56export(int, 20) var i
57# Allow integer values from -10 to 20.
58export(int, -10, 20) var j
59# Allow floats from -10 to 20 and snap the value to multiples of 0.2.
60export(float, -10, 20, 0.2) var k
61# Allow values 'y = exp(x)' where 'y' varies between 100 and 1000
62# while snapping to steps of 20. The editor will present a
63# slider for easily editing the value.
64export(float, EXP, 100, 1000, 20) var l
65
66# Floats with easing hint
67
68# Display a visual representation of the 'ease()' function
69# when editing.
70export(float, EASE) var transition_speed
71
72# Colors
73
74# Color given as red-green-blue value (alpha will always be 1).
75export(Color, RGB) var col
76# Color given as red-green-blue-alpha value.
77export(Color, RGBA) var col
78
79# Nodes
80
81# Another node in the scene can be exported as a NodePath.
82export(NodePath) var node_path
83# Do take note that the node itself isn't being exported -
84# there is one more step to call the true node:
85var node = get_node(node_path)
86
87# Resources
88
89export(Resource) var resource
90# In the Inspector, you can then drag and drop a resource file
91# from the FileSystem dock into the variable slot.
92
93# Opening the inspector dropdown may result in an
94# extremely long list of possible classes to create, however.
95# Therefore, if you specify an extension of Resource such as:
96export(AnimationNode) var resource
97# The drop-down menu will be limited to AnimationNode and all
98# its inherited classes.
99