/
MeshLibrary.hx
146 lines (120 loc) · 4.03 KB
/
MeshLibrary.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
A library of meshes. Contains a list of `godot.Mesh` resources, each with a name and ID. Each item can also include collision and navigation shapes. This resource is used in `godot.GridMap`.
**/
@:libType
@:csNative
@:native("Godot.MeshLibrary")
@:autoBuild(godot.Godot.buildUserClass())
extern class MeshLibrary extends godot.Resource {
@:native("new")
public function new():Void;
/**
Creates a new item in the library with the given ID.
You can get an unused ID from `godot.MeshLibrary.getLastUnusedItemId`.
**/
@:native("CreateItem")
public function createItem(id:Int):Void;
/**
Sets the item's name.
This name is shown in the editor. It can also be used to look up the item later using `godot.MeshLibrary.findItemByName`.
**/
@:native("SetItemName")
public function setItemName(id:Int, name:std.String):Void;
/**
Sets the item's mesh.
**/
@:native("SetItemMesh")
public function setItemMesh(id:Int, mesh:godot.Mesh):Void;
/**
Sets the transform to apply to the item's mesh.
**/
@:native("SetItemMeshTransform")
public function setItemMeshTransform(id:Int, meshTransform:godot.Transform):Void;
/**
Sets the item's navigation mesh.
**/
@:native("SetItemNavmesh")
public function setItemNavmesh(id:Int, navmesh:godot.NavigationMesh):Void;
/**
Sets the transform to apply to the item's navigation mesh.
**/
@:native("SetItemNavmeshTransform")
public function setItemNavmeshTransform(id:Int, navmesh:godot.Transform):Void;
/**
Sets an item's collision shapes.
The array should consist of `godot.Shape` objects, each followed by a `godot.Transform` that will be applied to it. For shapes that should not have a transform, use `Transform.IDENTITY`.
**/
@:native("SetItemShapes")
public function setItemShapes(id:Int, shapes:godot.collections.Array):Void;
/**
Sets a texture to use as the item's preview icon in the editor.
**/
@:native("SetItemPreview")
public function setItemPreview(id:Int, texture:godot.Texture):Void;
/**
Returns the item's name.
**/
@:native("GetItemName")
public function getItemName(id:Int):std.String;
/**
Returns the item's mesh.
**/
@:native("GetItemMesh")
public function getItemMesh(id:Int):godot.Mesh;
/**
Returns the transform applied to the item's mesh.
**/
@:native("GetItemMeshTransform")
public function getItemMeshTransform(id:Int):godot.Transform;
/**
Returns the item's navigation mesh.
**/
@:native("GetItemNavmesh")
public function getItemNavmesh(id:Int):godot.NavigationMesh;
/**
Returns the transform applied to the item's navigation mesh.
**/
@:native("GetItemNavmeshTransform")
public function getItemNavmeshTransform(id:Int):godot.Transform;
/**
Returns an item's collision shapes.
The array consists of each `godot.Shape` followed by its `godot.Transform`.
**/
@:native("GetItemShapes")
public function getItemShapes(id:Int):godot.collections.Array;
/**
When running in the editor, returns a generated item preview (a 3D rendering in isometric perspective). When used in a running project, returns the manually-defined item preview which can be set using `godot.MeshLibrary.setItemPreview`. Returns an empty `godot.Texture` if no preview was manually set in a running project.
**/
@:native("GetItemPreview")
public function getItemPreview(id:Int):godot.Texture;
/**
Removes the item.
**/
@:native("RemoveItem")
public function removeItem(id:Int):Void;
/**
Returns the first item with the given name.
**/
@:native("FindItemByName")
public function findItemByName(name:std.String):Int;
/**
Clears the library.
**/
@:native("Clear")
public function clear():Void;
/**
Returns the list of item IDs in use.
**/
public extern inline function getItemList():std.Array<Int> {
return cs.Lib.array(cs.Syntax.code("{0}.GetItemList()", this));
}
/**
Gets an unused ID for a new item.
**/
@:native("GetLastUnusedItemId")
public function getLastUnusedItemId():Int;
}