/
Texture.hx
196 lines (155 loc) · 8.73 KB
/
Texture.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
// Automatically generated Godot externs: DO NOT EDIT
// MIT licensed, see LICENSE.md
package godot;
import cs.system.*;
/**
A texture works by registering an image in the video hardware, which then can be used in 3D models or 2D `godot.Sprite` or GUI `godot.Control`.
Textures are often created by loading them from a file. See `@GDScript.load`.
`godot.Texture` is a base for other resources. It cannot be used directly.
Note: The maximum texture size is 16384×16384 pixels due to graphics hardware limitations. Larger textures may fail to import.
**/
@:libType
@:csNative
@:native("Godot.Texture")
@:autoBuild(godot.Godot.buildUserClass())
extern abstract class Texture extends godot.Resource {
/**
The texture's `godot.Texture_FlagsEnum`. `godot.Texture_FlagsEnum` are used to set various properties of the `godot.Texture`.
**/
@:native("Flags")
public var flags:UInt;
/**
Returns the texture width.
**/
@:native("GetWidth")
public function getWidth():Int;
/**
Returns the texture height.
**/
@:native("GetHeight")
public function getHeight():Int;
/**
Returns the texture size.
**/
@:native("GetSize")
public function getSize():godot.Vector2;
/**
Returns `true` if this `godot.Texture` has an alpha channel.
**/
@:native("HasAlpha")
public function hasAlpha():Bool;
@:native("SetFlags")
public function setFlags(flags:UInt):Void;
@:native("GetFlags")
public function getFlags():UInt;
#if doc_gen
/**
Draws the texture using a `godot.CanvasItem` with the `godot.VisualServer` API at the specified `position`. Equivalent to `godot.VisualServer.canvasItemAddTextureRect` with a rect at `position` and the size of this `godot.Texture`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("Draw")
public function draw(canvasItem:godot.RID, position:godot.Vector2, ?modulate:Null<godot.Color>, ?transpose:Bool, ?normalMap:godot.Texture):Void;
#else
/**
Draws the texture using a `godot.CanvasItem` with the `godot.VisualServer` API at the specified `position`. Equivalent to `godot.VisualServer.canvasItemAddTextureRect` with a rect at `position` and the size of this `godot.Texture`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("Draw")
public overload function draw(canvasItem:godot.RID, position:godot.Vector2):Void;
/**
Draws the texture using a `godot.CanvasItem` with the `godot.VisualServer` API at the specified `position`. Equivalent to `godot.VisualServer.canvasItemAddTextureRect` with a rect at `position` and the size of this `godot.Texture`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("Draw")
public overload function draw(canvasItem:godot.RID, position:godot.Vector2, modulate:Nullable1<godot.Color>):Void;
/**
Draws the texture using a `godot.CanvasItem` with the `godot.VisualServer` API at the specified `position`. Equivalent to `godot.VisualServer.canvasItemAddTextureRect` with a rect at `position` and the size of this `godot.Texture`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("Draw")
public overload function draw(canvasItem:godot.RID, position:godot.Vector2, modulate:Nullable1<godot.Color>, transpose:Bool):Void;
/**
Draws the texture using a `godot.CanvasItem` with the `godot.VisualServer` API at the specified `position`. Equivalent to `godot.VisualServer.canvasItemAddTextureRect` with a rect at `position` and the size of this `godot.Texture`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("Draw")
public overload function draw(canvasItem:godot.RID, position:godot.Vector2, modulate:Nullable1<godot.Color>, transpose:Bool, normalMap:godot.Texture):Void;
#end
#if doc_gen
/**
Draws the texture using a `godot.CanvasItem` with the `godot.VisualServer` API. Equivalent to `godot.VisualServer.canvasItemAddTextureRect`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("DrawRect")
public function drawRect(canvasItem:godot.RID, rect:godot.Rect2, tile:Bool, ?modulate:Null<godot.Color>, ?transpose:Bool, ?normalMap:godot.Texture):Void;
#else
/**
Draws the texture using a `godot.CanvasItem` with the `godot.VisualServer` API. Equivalent to `godot.VisualServer.canvasItemAddTextureRect`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("DrawRect")
public overload function drawRect(canvasItem:godot.RID, rect:godot.Rect2, tile:Bool):Void;
/**
Draws the texture using a `godot.CanvasItem` with the `godot.VisualServer` API. Equivalent to `godot.VisualServer.canvasItemAddTextureRect`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("DrawRect")
public overload function drawRect(canvasItem:godot.RID, rect:godot.Rect2, tile:Bool, modulate:Nullable1<godot.Color>):Void;
/**
Draws the texture using a `godot.CanvasItem` with the `godot.VisualServer` API. Equivalent to `godot.VisualServer.canvasItemAddTextureRect`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("DrawRect")
public overload function drawRect(canvasItem:godot.RID, rect:godot.Rect2, tile:Bool, modulate:Nullable1<godot.Color>, transpose:Bool):Void;
/**
Draws the texture using a `godot.CanvasItem` with the `godot.VisualServer` API. Equivalent to `godot.VisualServer.canvasItemAddTextureRect`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("DrawRect")
public overload function drawRect(canvasItem:godot.RID, rect:godot.Rect2, tile:Bool, modulate:Nullable1<godot.Color>, transpose:Bool, normalMap:godot.Texture):Void;
#end
#if doc_gen
/**
Draws a part of the texture using a `godot.CanvasItem` with the `godot.VisualServer` API. Equivalent to `godot.VisualServer.canvasItemAddTextureRectRegion`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("DrawRectRegion")
public function drawRectRegion(canvasItem:godot.RID, rect:godot.Rect2, srcRect:godot.Rect2, ?modulate:Null<godot.Color>, ?transpose:Bool, ?normalMap:godot.Texture, ?clipUv:Bool):Void;
#else
/**
Draws a part of the texture using a `godot.CanvasItem` with the `godot.VisualServer` API. Equivalent to `godot.VisualServer.canvasItemAddTextureRectRegion`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("DrawRectRegion")
public overload function drawRectRegion(canvasItem:godot.RID, rect:godot.Rect2, srcRect:godot.Rect2):Void;
/**
Draws a part of the texture using a `godot.CanvasItem` with the `godot.VisualServer` API. Equivalent to `godot.VisualServer.canvasItemAddTextureRectRegion`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("DrawRectRegion")
public overload function drawRectRegion(canvasItem:godot.RID, rect:godot.Rect2, srcRect:godot.Rect2, modulate:Nullable1<godot.Color>):Void;
/**
Draws a part of the texture using a `godot.CanvasItem` with the `godot.VisualServer` API. Equivalent to `godot.VisualServer.canvasItemAddTextureRectRegion`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("DrawRectRegion")
public overload function drawRectRegion(canvasItem:godot.RID, rect:godot.Rect2, srcRect:godot.Rect2, modulate:Nullable1<godot.Color>, transpose:Bool):Void;
/**
Draws a part of the texture using a `godot.CanvasItem` with the `godot.VisualServer` API. Equivalent to `godot.VisualServer.canvasItemAddTextureRectRegion`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("DrawRectRegion")
public overload function drawRectRegion(canvasItem:godot.RID, rect:godot.Rect2, srcRect:godot.Rect2, modulate:Nullable1<godot.Color>, transpose:Bool, normalMap:godot.Texture):Void;
/**
Draws a part of the texture using a `godot.CanvasItem` with the `godot.VisualServer` API. Equivalent to `godot.VisualServer.canvasItemAddTextureRectRegion`.
@param modulate If the parameter is null, then the default value is new Color(1, 1, 1, 1)
**/
@:native("DrawRectRegion")
public overload function drawRectRegion(canvasItem:godot.RID, rect:godot.Rect2, srcRect:godot.Rect2, modulate:Nullable1<godot.Color>, transpose:Bool, normalMap:godot.Texture, clipUv:Bool):Void;
#end
/**
Returns an `godot.Image` that is a copy of data from this `godot.Texture`. `godot.Image`s can be accessed and manipulated directly.
**/
@:native("GetData")
public function getData():godot.Image;
}