:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/TextureLayered.xml. .. _class_TextureLayered: TextureLayered ============== **Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` **Inherited By:** :ref:`CompressedTextureLayered`, :ref:`ImageTextureLayered`, :ref:`PlaceholderTextureLayered`, :ref:`TextureLayeredRD` Base class for texture types which contain the data of multiple :ref:`Image`\ s. Each image is of the same size and format. .. rst-class:: classref-introduction-group Description ----------- Base class for :ref:`ImageTextureLayered` and :ref:`CompressedTextureLayered`. Cannot be used directly, but contains all the functions necessary for accessing the derived resource types. See also :ref:`Texture3D`. Data is set on a per-layer basis. For :ref:`Texture2DArray`\ s, the layer specifies the array layer. All images need to have the same width, height and number of mipmap levels. A **TextureLayered** can be loaded with :ref:`ResourceLoader.load()`. Internally, Godot maps these files to their respective counterparts in the target rendering driver (Vulkan, OpenGL3). .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Format` | :ref:`_get_format`\ (\ ) |virtual| |required| |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_get_height`\ (\ ) |virtual| |required| |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Image` | :ref:`_get_layer_data`\ (\ layer_index\: :ref:`int`\ ) |virtual| |required| |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_get_layered_type`\ (\ ) |virtual| |required| |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_get_layers`\ (\ ) |virtual| |required| |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_get_width`\ (\ ) |virtual| |required| |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_has_mipmaps`\ (\ ) |virtual| |required| |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Format` | :ref:`get_format`\ (\ ) |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_height`\ (\ ) |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Image` | :ref:`get_layer_data`\ (\ layer\: :ref:`int`\ ) |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`LayeredType` | :ref:`get_layered_type`\ (\ ) |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_layers`\ (\ ) |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_width`\ (\ ) |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_mipmaps`\ (\ ) |const| | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_TextureLayered_LayeredType: .. rst-class:: classref-enumeration enum **LayeredType**: :ref:`🔗` .. _class_TextureLayered_constant_LAYERED_TYPE_2D_ARRAY: .. rst-class:: classref-enumeration-constant :ref:`LayeredType` **LAYERED_TYPE_2D_ARRAY** = ``0`` Texture is a generic :ref:`Texture2DArray`. .. _class_TextureLayered_constant_LAYERED_TYPE_CUBEMAP: .. rst-class:: classref-enumeration-constant :ref:`LayeredType` **LAYERED_TYPE_CUBEMAP** = ``1`` Texture is a :ref:`Cubemap`, with each side in its own layer (6 in total). .. _class_TextureLayered_constant_LAYERED_TYPE_CUBEMAP_ARRAY: .. rst-class:: classref-enumeration-constant :ref:`LayeredType` **LAYERED_TYPE_CUBEMAP_ARRAY** = ``2`` Texture is a :ref:`CubemapArray`, with each cubemap being made of 6 layers. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_TextureLayered_private_method__get_format: .. rst-class:: classref-method :ref:`Format` **_get_format**\ (\ ) |virtual| |required| |const| :ref:`🔗` Called when the **TextureLayered**'s format is queried. .. rst-class:: classref-item-separator ---- .. _class_TextureLayered_private_method__get_height: .. rst-class:: classref-method :ref:`int` **_get_height**\ (\ ) |virtual| |required| |const| :ref:`🔗` Called when the **TextureLayered**'s height is queried. .. rst-class:: classref-item-separator ---- .. _class_TextureLayered_private_method__get_layer_data: .. rst-class:: classref-method :ref:`Image` **_get_layer_data**\ (\ layer_index\: :ref:`int`\ ) |virtual| |required| |const| :ref:`🔗` Called when the data for a layer in the **TextureLayered** is queried. .. rst-class:: classref-item-separator ---- .. _class_TextureLayered_private_method__get_layered_type: .. rst-class:: classref-method :ref:`int` **_get_layered_type**\ (\ ) |virtual| |required| |const| :ref:`🔗` Called when the layers' type in the **TextureLayered** is queried. .. rst-class:: classref-item-separator ---- .. _class_TextureLayered_private_method__get_layers: .. rst-class:: classref-method :ref:`int` **_get_layers**\ (\ ) |virtual| |required| |const| :ref:`🔗` Called when the number of layers in the **TextureLayered** is queried. .. rst-class:: classref-item-separator ---- .. _class_TextureLayered_private_method__get_width: .. rst-class:: classref-method :ref:`int` **_get_width**\ (\ ) |virtual| |required| |const| :ref:`🔗` Called when the **TextureLayered**'s width queried. .. rst-class:: classref-item-separator ---- .. _class_TextureLayered_private_method__has_mipmaps: .. rst-class:: classref-method :ref:`bool` **_has_mipmaps**\ (\ ) |virtual| |required| |const| :ref:`🔗` Called when the presence of mipmaps in the **TextureLayered** is queried. .. rst-class:: classref-item-separator ---- .. _class_TextureLayered_method_get_format: .. rst-class:: classref-method :ref:`Format` **get_format**\ (\ ) |const| :ref:`🔗` Returns the current format being used by this texture. .. rst-class:: classref-item-separator ---- .. _class_TextureLayered_method_get_height: .. rst-class:: classref-method :ref:`int` **get_height**\ (\ ) |const| :ref:`🔗` Returns the height of the texture in pixels. Height is typically represented by the Y axis. .. rst-class:: classref-item-separator ---- .. _class_TextureLayered_method_get_layer_data: .. rst-class:: classref-method :ref:`Image` **get_layer_data**\ (\ layer\: :ref:`int`\ ) |const| :ref:`🔗` Returns an :ref:`Image` resource with the data from specified ``layer``. .. rst-class:: classref-item-separator ---- .. _class_TextureLayered_method_get_layered_type: .. rst-class:: classref-method :ref:`LayeredType` **get_layered_type**\ (\ ) |const| :ref:`🔗` Returns the **TextureLayered**'s type. The type determines how the data is accessed, with cubemaps having special types. .. rst-class:: classref-item-separator ---- .. _class_TextureLayered_method_get_layers: .. rst-class:: classref-method :ref:`int` **get_layers**\ (\ ) |const| :ref:`🔗` Returns the number of referenced :ref:`Image`\ s. .. rst-class:: classref-item-separator ---- .. _class_TextureLayered_method_get_width: .. rst-class:: classref-method :ref:`int` **get_width**\ (\ ) |const| :ref:`🔗` Returns the width of the texture in pixels. Width is typically represented by the X axis. .. rst-class:: classref-item-separator ---- .. _class_TextureLayered_method_has_mipmaps: .. rst-class:: classref-method :ref:`bool` **has_mipmaps**\ (\ ) |const| :ref:`🔗` Returns ``true`` if the layers have generated mipmaps. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |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.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`