:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/AtlasTexture.xml. .. _class_AtlasTexture: AtlasTexture ============ **Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` Crops out one part of a texture, such as a texture from a texture atlas. .. rst-class:: classref-introduction-group Description ----------- :ref:`Texture` resource that crops out one part of the :ref:`atlas` texture, defined by :ref:`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 :ref:`Texture` for the :ref:`atlas`, a :ref:`region` that defines the area of :ref:`atlas` to use, and a :ref:`margin` that defines the border width. \ **AtlasTexture** cannot be used in an :ref:`AnimatedTexture`, cannot be tiled in nodes such as :ref:`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 :ref:`Texture.FLAG_REPEAT` and :ref:`Texture.FLAG_MIRRORED_REPEAT` flags are ignored when using an AtlasTexture. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+ | :ref:`Texture` | :ref:`atlas` | | +-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+ | :ref:`bool` | :ref:`filter_clip` | ``false`` | +-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+ | :ref:`int` | flags | ``0`` (overrides :ref:`Texture`) | +-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+ | :ref:`Rect2` | :ref:`margin` | ``Rect2( 0, 0, 0, 0 )`` | +-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+ | :ref:`Rect2` | :ref:`region` | ``Rect2( 0, 0, 0, 0 )`` | +-------------------------------+-------------------------------------------------------------+----------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_AtlasTexture_property_atlas: .. rst-class:: classref-property :ref:`Texture` **atlas** .. rst-class:: classref-property-setget - void **set_atlas** **(** :ref:`Texture` value **)** - :ref:`Texture` **get_atlas** **(** **)** The texture that contains the atlas. Can be any :ref:`Texture` subtype. .. rst-class:: classref-item-separator ---- .. _class_AtlasTexture_property_filter_clip: .. rst-class:: classref-property :ref:`bool` **filter_clip** = ``false`` .. rst-class:: classref-property-setget - void **set_filter_clip** **(** :ref:`bool` value **)** - :ref:`bool` **has_filter_clip** **(** **)** If ``true``, clips the area outside of the region to avoid bleeding of the surrounding texture pixels. .. rst-class:: classref-item-separator ---- .. _class_AtlasTexture_property_margin: .. rst-class:: classref-property :ref:`Rect2` **margin** = ``Rect2( 0, 0, 0, 0 )`` .. rst-class:: classref-property-setget - void **set_margin** **(** :ref:`Rect2` value **)** - :ref:`Rect2` **get_margin** **(** **)** The margin around the region. The :ref:`Rect2`'s :ref:`Rect2.size` parameter ("w" and "h" in the editor) resizes the texture so it fits within the margin. .. rst-class:: classref-item-separator ---- .. _class_AtlasTexture_property_region: .. rst-class:: classref-property :ref:`Rect2` **region** = ``Rect2( 0, 0, 0, 0 )`` .. rst-class:: classref-property-setget - void **set_region** **(** :ref:`Rect2` value **)** - :ref:`Rect2` **get_region** **(** **)** The AtlasTexture's used region. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`