Table of Contents

Class AtlasTexture

Namespace
Godot
Assembly
GodotSharp.dll

Texture2D resource that draws only part of its Atlas texture, as defined by the Region. An additional Margin can also be set, which is useful for small adjustments.

Multiple AtlasTexture resources can be cropped from the same Atlas. Packing many smaller textures into a singular large texture helps to optimize video memory costs and render calls.

Note: AtlasTexture cannot be used in an AnimatedTexture, and may not tile properly in nodes such as TextureRect, when inside other AtlasTexture resources.

public class AtlasTexture : Texture2D, IDisposable
Inheritance
AtlasTexture
Implements
Inherited Members

Constructors

AtlasTexture()

public AtlasTexture()

Properties

Atlas

The texture that contains the atlas. Can be any type inheriting from Texture2D, including another AtlasTexture.

public Texture2D Atlas { get; set; }

Property Value

Texture2D

FilterClip

If true, the area outside of the Region is clipped to avoid bleeding of the surrounding texture pixels.

public bool FilterClip { get; set; }

Property Value

bool

Margin

The margin around the Region. Useful for small adjustments. If the Rect2.size of this property ("w" and "h" in the editor) is set, the drawn texture is resized to fit within the margin.

public Rect2 Margin { get; set; }

Property Value

Rect2

Region

The region used to draw the Atlas.

public Rect2 Region { get; set; }

Property Value

Rect2

Methods

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool