- draw
void draw(RID canvas_item, Vector2 position, Color modulate, bool transpose, Texture normal_map)
Draws the texture using a CanvasItem with the VisualServer API at the specified position. Equivalent to VisualServer.canvasItemAddTextureRect with a rect at position and the size of this Texture.
- drawRect
void drawRect(RID canvas_item, Rect2 rect, bool tile, Color modulate, bool transpose, Texture normal_map)
Draws the texture using a CanvasItem with the VisualServer API. Equivalent to VisualServer.canvasItemAddTextureRect.
- drawRectRegion
void drawRectRegion(RID canvas_item, Rect2 rect, Rect2 src_rect, Color modulate, bool transpose, Texture normal_map, bool clip_uv)
Draws a part of the texture using a CanvasItem with the VisualServer API. Equivalent to VisualServer.canvasItemAddTextureRectRegion.
- getData
Ref!Image getData()
Returns an Image that is a copy of data from this Texture. Images can be accessed and manipulated directly.
- getFlags
long getFlags()
- getHeight
long getHeight()
Returns the texture height.
- getSize
Vector2 getSize()
Returns the texture size.
- getWidth
long getWidth()
Returns the texture width.
- hasAlpha
bool hasAlpha()
Returns true if this Texture has an alpha channel.
- opAssign
typeof(null) opAssign(typeof(null) n)
- opEquals
bool opEquals(Texture other)
- opEquals
bool opEquals(typeof(null) n)
- setFlags
void setFlags(long flags)
- toHash
size_t toHash()
Texture for 2D and 3D.
A texture works by registering an image in the video hardware, which then can be used in 3D models or 2D Sprite or GUI Control. Textures are often created by loading them from a file. See @GDScript.load. 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.