AtlasTexture

Crops out one part of a texture, such as a texture from a texture atlas.

Texture resource that crops out one part of the atlas texture, defined by region. The main use case is cropping out textures from a texture atlas, which is a big texture file that packs multiple smaller textures. Consists of a Texture for the atlas, a region that defines the area of atlas to use, and a margin that defines the border width. AtlasTexture cannot be used in an AnimatedTexture, cannot be tiled in nodes such as TextureRect, and does not work properly if used inside of other AtlasTexture resources. Multiple AtlasTexture resources can be used to crop multiple textures from the atlas. Using a texture atlas helps to optimize video memory costs and render calls compared to using multiple small files. Note: AtlasTextures don't support repetition. The constant Texture.FLAG_REPEAT and constant Texture.FLAG_MIRRORED_REPEAT flags are ignored when using an AtlasTexture.

Members

Aliases

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

Functions

getAtlas
Ref!Texture getAtlas()
getMargin
Rect2 getMargin()
getRegion
Rect2 getRegion()
hasFilterClip
bool hasFilterClip()
opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(AtlasTexture other)
opEquals
bool opEquals(typeof(null) n)
setAtlas
void setAtlas(Texture atlas)
setFilterClip
void setFilterClip(bool enable)
setMargin
void setMargin(Rect2 margin)
setRegion
void setRegion(Rect2 region)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

atlas
Texture atlas [@property getter]
Texture atlas [@property setter]

The texture that contains the atlas. Can be any Texture subtype.

filterClip
bool filterClip [@property getter]
bool filterClip [@property setter]

If true, clips the area outside of the region to avoid bleeding of the surrounding texture pixels.

margin
Rect2 margin [@property getter]
Rect2 margin [@property setter]

The margin around the region. The Rect2's Rect2.size parameter ("w" and "h" in the editor) resizes the texture so it fits within the margin.

region
Rect2 region [@property getter]
Rect2 region [@property setter]

The AtlasTexture's used region.

Static functions

_new
AtlasTexture _new()

Construct a new instance of AtlasTexture. Note: use memnew!AtlasTexture 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