class_texturelayered.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/TextureLayered.xml.
  6. .. _class_TextureLayered:
  7. TextureLayered
  8. ==============
  9. **Inherits:** :ref:`Texture<class_Texture>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`CompressedTextureLayered<class_CompressedTextureLayered>`, :ref:`ImageTextureLayered<class_ImageTextureLayered>`, :ref:`PlaceholderTextureLayered<class_PlaceholderTextureLayered>`, :ref:`TextureLayeredRD<class_TextureLayeredRD>`
  11. 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.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. 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>`.
  16. Data is set on a per-layer basis. For :ref:`Texture2DArray<class_Texture2DArray>`\ s, the layer specifies the array layer.
  17. All images need to have the same width, height and number of mipmap levels.
  18. A **TextureLayered** can be loaded with :ref:`ResourceLoader.load<class_ResourceLoader_method_load>`.
  19. Internally, Godot maps these files to their respective counterparts in the target rendering driver (Vulkan, OpenGL3).
  20. .. rst-class:: classref-reftable-group
  21. Methods
  22. -------
  23. .. table::
  24. :widths: auto
  25. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`Format<enum_Image_Format>` | :ref:`_get_format<class_TextureLayered_private_method__get_format>`\ (\ ) |virtual| |const| |
  27. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`int<class_int>` | :ref:`_get_height<class_TextureLayered_private_method__get_height>`\ (\ ) |virtual| |const| |
  29. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`Image<class_Image>` | :ref:`_get_layer_data<class_TextureLayered_private_method__get_layer_data>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |virtual| |const| |
  31. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`int<class_int>` | :ref:`_get_layered_type<class_TextureLayered_private_method__get_layered_type>`\ (\ ) |virtual| |const| |
  33. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`int<class_int>` | :ref:`_get_layers<class_TextureLayered_private_method__get_layers>`\ (\ ) |virtual| |const| |
  35. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`int<class_int>` | :ref:`_get_width<class_TextureLayered_private_method__get_width>`\ (\ ) |virtual| |const| |
  37. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`bool<class_bool>` | :ref:`_has_mipmaps<class_TextureLayered_private_method__has_mipmaps>`\ (\ ) |virtual| |const| |
  39. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`Format<enum_Image_Format>` | :ref:`get_format<class_TextureLayered_method_get_format>`\ (\ ) |const| |
  41. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`int<class_int>` | :ref:`get_height<class_TextureLayered_method_get_height>`\ (\ ) |const| |
  43. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`Image<class_Image>` | :ref:`get_layer_data<class_TextureLayered_method_get_layer_data>`\ (\ layer\: :ref:`int<class_int>`\ ) |const| |
  45. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`LayeredType<enum_TextureLayered_LayeredType>` | :ref:`get_layered_type<class_TextureLayered_method_get_layered_type>`\ (\ ) |const| |
  47. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`int<class_int>` | :ref:`get_layers<class_TextureLayered_method_get_layers>`\ (\ ) |const| |
  49. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`int<class_int>` | :ref:`get_width<class_TextureLayered_method_get_width>`\ (\ ) |const| |
  51. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`bool<class_bool>` | :ref:`has_mipmaps<class_TextureLayered_method_has_mipmaps>`\ (\ ) |const| |
  53. +-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
  54. .. rst-class:: classref-section-separator
  55. ----
  56. .. rst-class:: classref-descriptions-group
  57. Enumerations
  58. ------------
  59. .. _enum_TextureLayered_LayeredType:
  60. .. rst-class:: classref-enumeration
  61. enum **LayeredType**: :ref:`🔗<enum_TextureLayered_LayeredType>`
  62. .. _class_TextureLayered_constant_LAYERED_TYPE_2D_ARRAY:
  63. .. rst-class:: classref-enumeration-constant
  64. :ref:`LayeredType<enum_TextureLayered_LayeredType>` **LAYERED_TYPE_2D_ARRAY** = ``0``
  65. Texture is a generic :ref:`Texture2DArray<class_Texture2DArray>`.
  66. .. _class_TextureLayered_constant_LAYERED_TYPE_CUBEMAP:
  67. .. rst-class:: classref-enumeration-constant
  68. :ref:`LayeredType<enum_TextureLayered_LayeredType>` **LAYERED_TYPE_CUBEMAP** = ``1``
  69. Texture is a :ref:`Cubemap<class_Cubemap>`, with each side in its own layer (6 in total).
  70. .. _class_TextureLayered_constant_LAYERED_TYPE_CUBEMAP_ARRAY:
  71. .. rst-class:: classref-enumeration-constant
  72. :ref:`LayeredType<enum_TextureLayered_LayeredType>` **LAYERED_TYPE_CUBEMAP_ARRAY** = ``2``
  73. Texture is a :ref:`CubemapArray<class_CubemapArray>`, with each cubemap being made of 6 layers.
  74. .. rst-class:: classref-section-separator
  75. ----
  76. .. rst-class:: classref-descriptions-group
  77. Method Descriptions
  78. -------------------
  79. .. _class_TextureLayered_private_method__get_format:
  80. .. rst-class:: classref-method
  81. :ref:`Format<enum_Image_Format>` **_get_format**\ (\ ) |virtual| |const| :ref:`🔗<class_TextureLayered_private_method__get_format>`
  82. Called when the **TextureLayered**'s format is queried.
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _class_TextureLayered_private_method__get_height:
  86. .. rst-class:: classref-method
  87. :ref:`int<class_int>` **_get_height**\ (\ ) |virtual| |const| :ref:`🔗<class_TextureLayered_private_method__get_height>`
  88. Called when the **TextureLayered**'s height is queried.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_TextureLayered_private_method__get_layer_data:
  92. .. rst-class:: classref-method
  93. :ref:`Image<class_Image>` **_get_layer_data**\ (\ layer_index\: :ref:`int<class_int>`\ ) |virtual| |const| :ref:`🔗<class_TextureLayered_private_method__get_layer_data>`
  94. Called when the data for a layer in the **TextureLayered** is queried.
  95. .. rst-class:: classref-item-separator
  96. ----
  97. .. _class_TextureLayered_private_method__get_layered_type:
  98. .. rst-class:: classref-method
  99. :ref:`int<class_int>` **_get_layered_type**\ (\ ) |virtual| |const| :ref:`🔗<class_TextureLayered_private_method__get_layered_type>`
  100. Called when the layers' type in the **TextureLayered** is queried.
  101. .. rst-class:: classref-item-separator
  102. ----
  103. .. _class_TextureLayered_private_method__get_layers:
  104. .. rst-class:: classref-method
  105. :ref:`int<class_int>` **_get_layers**\ (\ ) |virtual| |const| :ref:`🔗<class_TextureLayered_private_method__get_layers>`
  106. Called when the number of layers in the **TextureLayered** is queried.
  107. .. rst-class:: classref-item-separator
  108. ----
  109. .. _class_TextureLayered_private_method__get_width:
  110. .. rst-class:: classref-method
  111. :ref:`int<class_int>` **_get_width**\ (\ ) |virtual| |const| :ref:`🔗<class_TextureLayered_private_method__get_width>`
  112. Called when the **TextureLayered**'s width queried.
  113. .. rst-class:: classref-item-separator
  114. ----
  115. .. _class_TextureLayered_private_method__has_mipmaps:
  116. .. rst-class:: classref-method
  117. :ref:`bool<class_bool>` **_has_mipmaps**\ (\ ) |virtual| |const| :ref:`🔗<class_TextureLayered_private_method__has_mipmaps>`
  118. Called when the presence of mipmaps in the **TextureLayered** is queried.
  119. .. rst-class:: classref-item-separator
  120. ----
  121. .. _class_TextureLayered_method_get_format:
  122. .. rst-class:: classref-method
  123. :ref:`Format<enum_Image_Format>` **get_format**\ (\ ) |const| :ref:`🔗<class_TextureLayered_method_get_format>`
  124. Returns the current format being used by this texture. See :ref:`Format<enum_Image_Format>` for details.
  125. .. rst-class:: classref-item-separator
  126. ----
  127. .. _class_TextureLayered_method_get_height:
  128. .. rst-class:: classref-method
  129. :ref:`int<class_int>` **get_height**\ (\ ) |const| :ref:`🔗<class_TextureLayered_method_get_height>`
  130. Returns the height of the texture in pixels. Height is typically represented by the Y axis.
  131. .. rst-class:: classref-item-separator
  132. ----
  133. .. _class_TextureLayered_method_get_layer_data:
  134. .. rst-class:: classref-method
  135. :ref:`Image<class_Image>` **get_layer_data**\ (\ layer\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TextureLayered_method_get_layer_data>`
  136. Returns an :ref:`Image<class_Image>` resource with the data from specified ``layer``.
  137. .. rst-class:: classref-item-separator
  138. ----
  139. .. _class_TextureLayered_method_get_layered_type:
  140. .. rst-class:: classref-method
  141. :ref:`LayeredType<enum_TextureLayered_LayeredType>` **get_layered_type**\ (\ ) |const| :ref:`🔗<class_TextureLayered_method_get_layered_type>`
  142. Returns the **TextureLayered**'s type. The type determines how the data is accessed, with cubemaps having special types.
  143. .. rst-class:: classref-item-separator
  144. ----
  145. .. _class_TextureLayered_method_get_layers:
  146. .. rst-class:: classref-method
  147. :ref:`int<class_int>` **get_layers**\ (\ ) |const| :ref:`🔗<class_TextureLayered_method_get_layers>`
  148. Returns the number of referenced :ref:`Image<class_Image>`\ s.
  149. .. rst-class:: classref-item-separator
  150. ----
  151. .. _class_TextureLayered_method_get_width:
  152. .. rst-class:: classref-method
  153. :ref:`int<class_int>` **get_width**\ (\ ) |const| :ref:`🔗<class_TextureLayered_method_get_width>`
  154. Returns the width of the texture in pixels. Width is typically represented by the X axis.
  155. .. rst-class:: classref-item-separator
  156. ----
  157. .. _class_TextureLayered_method_has_mipmaps:
  158. .. rst-class:: classref-method
  159. :ref:`bool<class_bool>` **has_mipmaps**\ (\ ) |const| :ref:`🔗<class_TextureLayered_method_has_mipmaps>`
  160. Returns ``true`` if the layers have generated mipmaps.
  161. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  162. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  163. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  164. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  165. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  166. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  167. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  168. .. |void| replace:: :abbr:`void (No return value.)`