/
EditorScript.hx
59 lines (45 loc) · 1.62 KB
/
EditorScript.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
Scripts extending this class and implementing its `godot.EditorScript._Run` method can be executed from the Script Editor's File > Run menu option (or by pressing `Ctrl+Shift+X`) while the editor is running. This is useful for adding custom in-editor functionality to Godot. For more complex additions, consider using `godot.EditorPlugin`s instead.
Note: Extending scripts need to have `tool` mode enabled.
Example script:
```
tool
extends EditorScript
func _run():
print("Hello from the Godot Editor!")
```
Note: The script is run in the Editor context, which means the output is visible in the console window started with the Editor (stdout) instead of the usual Godot Output dock.
**/
@:libType
@:csNative
@:native("Godot.EditorScript")
@:autoBuild(godot.Godot.buildUserClass())
extern class EditorScript extends godot.Reference {
@:native("new")
public function new():Void;
/**
This method is executed by the Editor when File > Run is used.
**/
@:native("_Run")
public function _Run():Void;
/**
Adds `node` as a child of the root node in the editor context.
Warning: The implementation of this method is currently disabled.
**/
@:native("AddRootNode")
public function addRootNode(node:godot.Node):Void;
/**
Returns the Editor's currently active scene.
**/
@:native("GetScene")
public function getScene():godot.Node;
/**
Returns the `godot.EditorInterface` singleton instance.
**/
@:native("GetEditorInterface")
public function getEditorInterface():godot.EditorInterface;
}