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 [method @GDScript.load].
[Texture] is a base for other resources. It cannot be used directly.
[b]Note:[/b] The maximum texture size is 16384×16384 pixels due to graphics hardware limitations. Larger textures may fail to import.
Draws the texture using a [CanvasItem] with the [RenderingServer] API at the specified [code]position[/code]. Equivalent to [method RenderingServer.canvas_item_add_texture_rect] with a rect at [code]position[/code] and the size of this [Texture].
Draws the texture using a [CanvasItem] with the [RenderingServer] API. Equivalent to [method RenderingServer.canvas_item_add_texture_rect].
Draws a part of the texture using a [CanvasItem] with the [RenderingServer] API. Equivalent to [method RenderingServer.canvas_item_add_texture_rect_region].
Returns an [Image] that is a copy of data from this [Texture]. [Image]s can be accessed and manipulated directly.
Returns the texture height.
Returns the texture size.
Returns the texture width.
Returns [code]true[/code] if this [Texture] has an alpha channel.
The texture's [enum Flags]. [enum Flags] are used to set various properties of the [Texture].
Default flags. [constant FLAG_MIPMAPS], [constant FLAG_REPEAT] and [constant FLAG_FILTER] are enabled.
Generates mipmaps, which are smaller versions of the same texture to use when zoomed out, keeping the aspect ratio.
Repeats the texture (instead of clamp to edge).
[b]Note:[/b] Ignored when using an [AtlasTexture] as these don't support repetition.
Uses a magnifying filter, to enable smooth zooming in of the texture.
Uses anisotropic mipmap filtering. Generates smaller versions of the same texture with different aspect ratios.
This results in better-looking textures when viewed from oblique angles.
Converts the texture to the sRGB color space.
Repeats the texture with alternate sections mirrored.
[b]Note:[/b] Ignored when using an [AtlasTexture] as these don't support repetition.
Texture is a video surface.