File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,32 @@ export default class MySprite extends godot.Sprite {
70
70
godot .register_property (MySprite, ' direction' , new godot.Vector2 (1 , 0 ));
71
71
```
72
72
73
+ There are 2 ways of using the ` godot.register_property ` , the thrid param can either be
74
+ a default value for the property you're trying to export or an object giving a more detailed
75
+ description on how the editor should show it.
76
+
77
+ ``` js
78
+ function register_property (target : GodotClass | godot .Object , name : string , value : any );
79
+ function register_property(target: GodotClass | godot.Object, name: string, info: PropertyInfo);
80
+ ```
81
+
82
+ So calling the register_property like this:
83
+ ```js
84
+ godot.register_property(MyClass, 'number_value', 3.14);
85
+ ```
86
+
87
+ Is the simplified version of:
88
+ ```js
89
+ godot.register_property(MyClass, 'number_value', {
90
+ type: godot .TYPE_REAL ,
91
+ hint: godot .PropertyHint .PROPERTY_HINT_NONE ,
92
+ hint_string: " " ,
93
+ default: 3.14
94
+ });
95
+ ```
96
+
97
+ For more detail on how to use it, [ click here] ( https://github.com/GodotExplorer/ECMAScript/issues/24#issuecomment-655584829 ) .
98
+
73
99
#### About the API
74
100
75
101
All of godots api's are defined within the ` godot ` namespace.
You can’t perform that action at this time.
0 commit comments