Texture

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.

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

Constants
enum Constants
Flags
enum Flags

Functions

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()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

flags
long flags [@property getter]
long flags [@property setter]

The texture's flags. flags are used to set various properties of the Texture.

Static functions

_new
Texture _new()

Construct a new instance of Texture. Note: use memnew!Texture instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta