class_texturelayered.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/TextureLayered.xml.
  6. .. _class_TextureLayered:
  7. TextureLayered
  8. ==============
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`Texture3D<class_Texture3D>`, :ref:`TextureArray<class_TextureArray>`
  11. Base class for 3D texture types.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Base class for :ref:`Texture3D<class_Texture3D>` and :ref:`TextureArray<class_TextureArray>`. Cannot be used directly, but contains all the functions necessary for accessing and using :ref:`Texture3D<class_Texture3D>` and :ref:`TextureArray<class_TextureArray>`. Data is set on a per-layer basis. For :ref:`Texture3D<class_Texture3D>`\ s, the layer specifies the depth or Z-index, they can be treated as a bunch of 2D slices. Similarly, for :ref:`TextureArray<class_TextureArray>`\ s, the layer specifies the array layer.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------+
  22. | :ref:`Dictionary<class_Dictionary>` | :ref:`data<class_TextureLayered_property_data>` | ``{"depth": 0,"flags": 7,"format": 37,"height": 0,"layers": [ ],"width": 0}`` |
  23. +-------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------+
  24. | :ref:`int<class_int>` | :ref:`flags<class_TextureLayered_property_flags>` | ``7`` |
  25. +-------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------+
  26. .. rst-class:: classref-reftable-group
  27. Methods
  28. -------
  29. .. table::
  30. :widths: auto
  31. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`int<class_int>` | :ref:`get_depth<class_TextureLayered_method_get_depth>` **(** **)** |const| |
  33. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`Format<enum_Image_Format>` | :ref:`get_format<class_TextureLayered_method_get_format>` **(** **)** |const| |
  35. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`int<class_int>` | :ref:`get_height<class_TextureLayered_method_get_height>` **(** **)** |const| |
  37. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`Image<class_Image>` | :ref:`get_layer_data<class_TextureLayered_method_get_layer_data>` **(** :ref:`int<class_int>` layer **)** |const| |
  39. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`int<class_int>` | :ref:`get_width<class_TextureLayered_method_get_width>` **(** **)** |const| |
  41. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`set_data_partial<class_TextureLayered_method_set_data_partial>` **(** :ref:`Image<class_Image>` image, :ref:`int<class_int>` x_offset, :ref:`int<class_int>` y_offset, :ref:`int<class_int>` layer, :ref:`int<class_int>` mipmap=0 **)** |
  43. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | void | :ref:`set_layer_data<class_TextureLayered_method_set_layer_data>` **(** :ref:`Image<class_Image>` image, :ref:`int<class_int>` layer **)** |
  45. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. .. rst-class:: classref-section-separator
  47. ----
  48. .. rst-class:: classref-descriptions-group
  49. Enumerations
  50. ------------
  51. .. _enum_TextureLayered_Flags:
  52. .. rst-class:: classref-enumeration
  53. enum **Flags**:
  54. .. _class_TextureLayered_constant_FLAGS_DEFAULT_TEXTURE_ARRAY:
  55. .. rst-class:: classref-enumeration-constant
  56. :ref:`Flags<enum_TextureLayered_Flags>` **FLAGS_DEFAULT_TEXTURE_ARRAY** = ``7``
  57. Default flags for :ref:`TextureArray<class_TextureArray>`. :ref:`FLAG_MIPMAPS<class_TextureLayered_constant_FLAG_MIPMAPS>`, :ref:`FLAG_REPEAT<class_TextureLayered_constant_FLAG_REPEAT>` and :ref:`FLAG_FILTER<class_TextureLayered_constant_FLAG_FILTER>` are enabled.
  58. .. _class_TextureLayered_constant_FLAGS_DEFAULT_TEXTURE_3D:
  59. .. rst-class:: classref-enumeration-constant
  60. :ref:`Flags<enum_TextureLayered_Flags>` **FLAGS_DEFAULT_TEXTURE_3D** = ``4``
  61. Default flags for :ref:`Texture3D<class_Texture3D>`. :ref:`FLAG_FILTER<class_TextureLayered_constant_FLAG_FILTER>` is enabled.
  62. .. _class_TextureLayered_constant_FLAG_MIPMAPS:
  63. .. rst-class:: classref-enumeration-constant
  64. :ref:`Flags<enum_TextureLayered_Flags>` **FLAG_MIPMAPS** = ``1``
  65. Texture will generate mipmaps on creation.
  66. .. _class_TextureLayered_constant_FLAG_REPEAT:
  67. .. rst-class:: classref-enumeration-constant
  68. :ref:`Flags<enum_TextureLayered_Flags>` **FLAG_REPEAT** = ``2``
  69. Texture will repeat when UV used is outside the 0-1 range.
  70. .. _class_TextureLayered_constant_FLAG_FILTER:
  71. .. rst-class:: classref-enumeration-constant
  72. :ref:`Flags<enum_TextureLayered_Flags>` **FLAG_FILTER** = ``4``
  73. Use filtering when reading from texture. Filtering smooths out pixels. Turning filtering off is slightly faster and more appropriate when you need access to individual pixels.
  74. .. _class_TextureLayered_constant_FLAG_ANISOTROPIC_FILTER:
  75. .. rst-class:: classref-enumeration-constant
  76. :ref:`Flags<enum_TextureLayered_Flags>` **FLAG_ANISOTROPIC_FILTER** = ``8``
  77. Uses anisotropic mipmap filtering. Generates smaller versions of the same texture with different aspect ratios.
  78. This results in better-looking textures when viewed from oblique angles.
  79. .. rst-class:: classref-section-separator
  80. ----
  81. .. rst-class:: classref-descriptions-group
  82. Property Descriptions
  83. ---------------------
  84. .. _class_TextureLayered_property_data:
  85. .. rst-class:: classref-property
  86. :ref:`Dictionary<class_Dictionary>` **data** = ``{"depth": 0,"flags": 7,"format": 37,"height": 0,"layers": [ ],"width": 0}``
  87. Returns a dictionary with all the data used by this texture.
  88. .. rst-class:: classref-item-separator
  89. ----
  90. .. _class_TextureLayered_property_flags:
  91. .. rst-class:: classref-property
  92. :ref:`int<class_int>` **flags** = ``7``
  93. .. rst-class:: classref-property-setget
  94. - void **set_flags** **(** :ref:`int<class_int>` value **)**
  95. - :ref:`int<class_int>` **get_flags** **(** **)**
  96. Specifies which :ref:`Flags<enum_TextureLayered_Flags>` apply to this texture.
  97. .. rst-class:: classref-section-separator
  98. ----
  99. .. rst-class:: classref-descriptions-group
  100. Method Descriptions
  101. -------------------
  102. .. _class_TextureLayered_method_get_depth:
  103. .. rst-class:: classref-method
  104. :ref:`int<class_int>` **get_depth** **(** **)** |const|
  105. Returns the depth of the texture. Depth is the 3rd dimension (typically Z-axis).
  106. .. rst-class:: classref-item-separator
  107. ----
  108. .. _class_TextureLayered_method_get_format:
  109. .. rst-class:: classref-method
  110. :ref:`Format<enum_Image_Format>` **get_format** **(** **)** |const|
  111. Returns the current format being used by this texture. See :ref:`Format<enum_Image_Format>` for details.
  112. .. rst-class:: classref-item-separator
  113. ----
  114. .. _class_TextureLayered_method_get_height:
  115. .. rst-class:: classref-method
  116. :ref:`int<class_int>` **get_height** **(** **)** |const|
  117. Returns the height of the texture. Height is typically represented by the Y-axis.
  118. .. rst-class:: classref-item-separator
  119. ----
  120. .. _class_TextureLayered_method_get_layer_data:
  121. .. rst-class:: classref-method
  122. :ref:`Image<class_Image>` **get_layer_data** **(** :ref:`int<class_int>` layer **)** |const|
  123. Returns an :ref:`Image<class_Image>` resource with the data from specified ``layer``.
  124. .. rst-class:: classref-item-separator
  125. ----
  126. .. _class_TextureLayered_method_get_width:
  127. .. rst-class:: classref-method
  128. :ref:`int<class_int>` **get_width** **(** **)** |const|
  129. Returns the width of the texture. Width is typically represented by the X-axis.
  130. .. rst-class:: classref-item-separator
  131. ----
  132. .. _class_TextureLayered_method_set_data_partial:
  133. .. rst-class:: classref-method
  134. void **set_data_partial** **(** :ref:`Image<class_Image>` image, :ref:`int<class_int>` x_offset, :ref:`int<class_int>` y_offset, :ref:`int<class_int>` layer, :ref:`int<class_int>` mipmap=0 **)**
  135. Partially sets the data for a specified ``layer`` by overwriting using the data of the specified ``image``. ``x_offset`` and ``y_offset`` determine where the :ref:`Image<class_Image>` is "stamped" over the texture. The ``image`` must fit within the texture.
  136. .. rst-class:: classref-item-separator
  137. ----
  138. .. _class_TextureLayered_method_set_layer_data:
  139. .. rst-class:: classref-method
  140. void **set_layer_data** **(** :ref:`Image<class_Image>` image, :ref:`int<class_int>` layer **)**
  141. Sets the data for the specified layer. Data takes the form of a 2-dimensional :ref:`Image<class_Image>` resource.
  142. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  143. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  144. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  145. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`