Files
godot-docs/classes/class_texturelayered.rst
2024-05-07 11:26:31 +00:00

291 lines
13 KiB
ReStructuredText

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/TextureLayered.xml.
.. _class_TextureLayered:
TextureLayered
==============
**Inherits:** :ref:`Texture<class_Texture>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`CompressedTextureLayered<class_CompressedTextureLayered>`, :ref:`ImageTextureLayered<class_ImageTextureLayered>`, :ref:`PlaceholderTextureLayered<class_PlaceholderTextureLayered>`, :ref:`TextureLayeredRD<class_TextureLayeredRD>`
Base class for texture types which contain the data of multiple :ref:`Image<class_Image>`\ s. Each image is of the same size and format.
.. rst-class:: classref-introduction-group
Description
-----------
Base class for :ref:`ImageTextureLayered<class_ImageTextureLayered>` and :ref:`CompressedTextureLayered<class_CompressedTextureLayered>`. Cannot be used directly, but contains all the functions necessary for accessing the derived resource types. See also :ref:`Texture3D<class_Texture3D>`.
Data is set on a per-layer basis. For :ref:`Texture2DArray<class_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<class_ResourceLoader_method_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<enum_Image_Format>` | :ref:`_get_format<class_TextureLayered_private_method__get_format>` **(** **)** |virtual| |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`_get_height<class_TextureLayered_private_method__get_height>` **(** **)** |virtual| |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Image<class_Image>` | :ref:`_get_layer_data<class_TextureLayered_private_method__get_layer_data>` **(** :ref:`int<class_int>` layer_index **)** |virtual| |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`_get_layered_type<class_TextureLayered_private_method__get_layered_type>` **(** **)** |virtual| |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`_get_layers<class_TextureLayered_private_method__get_layers>` **(** **)** |virtual| |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`_get_width<class_TextureLayered_private_method__get_width>` **(** **)** |virtual| |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`_has_mipmaps<class_TextureLayered_private_method__has_mipmaps>` **(** **)** |virtual| |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Format<enum_Image_Format>` | :ref:`get_format<class_TextureLayered_method_get_format>` **(** **)** |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_height<class_TextureLayered_method_get_height>` **(** **)** |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Image<class_Image>` | :ref:`get_layer_data<class_TextureLayered_method_get_layer_data>` **(** :ref:`int<class_int>` layer **)** |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`LayeredType<enum_TextureLayered_LayeredType>` | :ref:`get_layered_type<class_TextureLayered_method_get_layered_type>` **(** **)** |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_layers<class_TextureLayered_method_get_layers>` **(** **)** |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_width<class_TextureLayered_method_get_width>` **(** **)** |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_mipmaps<class_TextureLayered_method_has_mipmaps>` **(** **)** |const| |
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_TextureLayered_LayeredType:
.. rst-class:: classref-enumeration
enum **LayeredType**:
.. _class_TextureLayered_constant_LAYERED_TYPE_2D_ARRAY:
.. rst-class:: classref-enumeration-constant
:ref:`LayeredType<enum_TextureLayered_LayeredType>` **LAYERED_TYPE_2D_ARRAY** = ``0``
Texture is a generic :ref:`Texture2DArray<class_Texture2DArray>`.
.. _class_TextureLayered_constant_LAYERED_TYPE_CUBEMAP:
.. rst-class:: classref-enumeration-constant
:ref:`LayeredType<enum_TextureLayered_LayeredType>` **LAYERED_TYPE_CUBEMAP** = ``1``
Texture is a :ref:`Cubemap<class_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<enum_TextureLayered_LayeredType>` **LAYERED_TYPE_CUBEMAP_ARRAY** = ``2``
Texture is a :ref:`CubemapArray<class_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<enum_Image_Format>` **_get_format** **(** **)** |virtual| |const|
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<class_int>` **_get_height** **(** **)** |virtual| |const|
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<class_Image>` **_get_layer_data** **(** :ref:`int<class_int>` layer_index **)** |virtual| |const|
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<class_int>` **_get_layered_type** **(** **)** |virtual| |const|
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<class_int>` **_get_layers** **(** **)** |virtual| |const|
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<class_int>` **_get_width** **(** **)** |virtual| |const|
Called when the **TextureLayered**'s width queried.
.. rst-class:: classref-item-separator
----
.. _class_TextureLayered_private_method__has_mipmaps:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **_has_mipmaps** **(** **)** |virtual| |const|
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<enum_Image_Format>` **get_format** **(** **)** |const|
Returns the current format being used by this texture. See :ref:`Format<enum_Image_Format>` for details.
.. rst-class:: classref-item-separator
----
.. _class_TextureLayered_method_get_height:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_height** **(** **)** |const|
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<class_Image>` **get_layer_data** **(** :ref:`int<class_int>` layer **)** |const|
Returns an :ref:`Image<class_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<enum_TextureLayered_LayeredType>` **get_layered_type** **(** **)** |const|
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<class_int>` **get_layers** **(** **)** |const|
Returns the number of referenced :ref:`Image<class_Image>`\ s.
.. rst-class:: classref-item-separator
----
.. _class_TextureLayered_method_get_width:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_width** **(** **)** |const|
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<class_bool>` **has_mipmaps** **(** **)** |const|
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.)`
.. |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.)`