class_texturelayered.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the TextureLayered.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_TextureLayered:
  6. TextureLayered
  7. ==============
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. **Inherited By:** :ref:`Texture3D<class_Texture3D>`, :ref:`TextureArray<class_TextureArray>`
  10. Base class for 3D texture types.
  11. Description
  12. -----------
  13. 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 sepcifies 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.
  14. Properties
  15. ----------
  16. +-------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------+
  17. | :ref:`Dictionary<class_Dictionary>` | :ref:`data<class_TextureLayered_property_data>` | ``{"depth": 0,"flags": 4,"format": 37,"height": 0,"layers": [ ],"width": 0}`` |
  18. +-------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------+
  19. | :ref:`int<class_int>` | :ref:`flags<class_TextureLayered_property_flags>` | ``4`` |
  20. +-------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------+
  21. Methods
  22. -------
  23. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | void | :ref:`create<class_TextureLayered_method_create>` **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`int<class_int>` depth, :ref:`Format<enum_Image_Format>` format, :ref:`int<class_int>` flags=4 **)** |
  25. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`int<class_int>` | :ref:`get_depth<class_TextureLayered_method_get_depth>` **(** **)** |const| |
  27. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`Format<enum_Image_Format>` | :ref:`get_format<class_TextureLayered_method_get_format>` **(** **)** |const| |
  29. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`int<class_int>` | :ref:`get_height<class_TextureLayered_method_get_height>` **(** **)** |const| |
  31. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`Image<class_Image>` | :ref:`get_layer_data<class_TextureLayered_method_get_layer_data>` **(** :ref:`int<class_int>` layer **)** |const| |
  33. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`int<class_int>` | :ref:`get_width<class_TextureLayered_method_get_width>` **(** **)** |const| |
  35. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | 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 **)** |
  37. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`set_layer_data<class_TextureLayered_method_set_layer_data>` **(** :ref:`Image<class_Image>` image, :ref:`int<class_int>` layer **)** |
  39. +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. Enumerations
  41. ------------
  42. .. _enum_TextureLayered_Flags:
  43. .. _class_TextureLayered_constant_FLAG_MIPMAPS:
  44. .. _class_TextureLayered_constant_FLAG_REPEAT:
  45. .. _class_TextureLayered_constant_FLAG_FILTER:
  46. .. _class_TextureLayered_constant_FLAGS_DEFAULT:
  47. enum **Flags**:
  48. - **FLAG_MIPMAPS** = **1** --- Texture will generate mipmaps on creation.
  49. - **FLAG_REPEAT** = **2** --- Texture will repeat when UV used is outside the 0-1 range.
  50. - **FLAG_FILTER** = **4** --- 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.
  51. - **FLAGS_DEFAULT** = **4** --- Equivalent to :ref:`FLAG_FILTER<class_TextureLayered_constant_FLAG_FILTER>`.
  52. Property Descriptions
  53. ---------------------
  54. .. _class_TextureLayered_property_data:
  55. - :ref:`Dictionary<class_Dictionary>` **data**
  56. +-----------+--------------------------------------------------------------------------------+
  57. | *Default* | ``{"depth": 0,"flags": 4,"format": 37,"height": 0,"layers": [ ],"width": 0}`` |
  58. +-----------+--------------------------------------------------------------------------------+
  59. Returns a dictionary with all the data used by this texture.
  60. ----
  61. .. _class_TextureLayered_property_flags:
  62. - :ref:`int<class_int>` **flags**
  63. +-----------+------------------+
  64. | *Default* | ``4`` |
  65. +-----------+------------------+
  66. | *Setter* | set_flags(value) |
  67. +-----------+------------------+
  68. | *Getter* | get_flags() |
  69. +-----------+------------------+
  70. Specifies which :ref:`Flags<enum_TextureLayered_Flags>` apply to this texture.
  71. Method Descriptions
  72. -------------------
  73. .. _class_TextureLayered_method_create:
  74. - void **create** **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`int<class_int>` depth, :ref:`Format<enum_Image_Format>` format, :ref:`int<class_int>` flags=4 **)**
  75. Creates the :ref:`Texture3D<class_Texture3D>` or :ref:`TextureArray<class_TextureArray>` with specified ``width``, ``height``, and ``depth``. See :ref:`Format<enum_Image_Format>` for ``format`` options. See :ref:`Flags<enum_TextureLayered_Flags>` enumerator for ``flags`` options.
  76. ----
  77. .. _class_TextureLayered_method_get_depth:
  78. - :ref:`int<class_int>` **get_depth** **(** **)** |const|
  79. Returns the depth of the texture. Depth is the 3rd dimension (typically Z-axis).
  80. ----
  81. .. _class_TextureLayered_method_get_format:
  82. - :ref:`Format<enum_Image_Format>` **get_format** **(** **)** |const|
  83. Returns the current format being used by this texture. See :ref:`Format<enum_Image_Format>` for details.
  84. ----
  85. .. _class_TextureLayered_method_get_height:
  86. - :ref:`int<class_int>` **get_height** **(** **)** |const|
  87. Returns the height of the texture. Height is typically represented by the Y-axis.
  88. ----
  89. .. _class_TextureLayered_method_get_layer_data:
  90. - :ref:`Image<class_Image>` **get_layer_data** **(** :ref:`int<class_int>` layer **)** |const|
  91. Returns an :ref:`Image<class_Image>` resource with the data from specified ``layer``.
  92. ----
  93. .. _class_TextureLayered_method_get_width:
  94. - :ref:`int<class_int>` **get_width** **(** **)** |const|
  95. Returns the width of the texture. Width is typically represented by the X-axis.
  96. ----
  97. .. _class_TextureLayered_method_set_data_partial:
  98. - 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 **)**
  99. 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.
  100. ----
  101. .. _class_TextureLayered_method_set_layer_data:
  102. - void **set_layer_data** **(** :ref:`Image<class_Image>` image, :ref:`int<class_int>` layer **)**
  103. Sets the data for the specified layer. Data takes the form of a 2-dimensional :ref:`Image<class_Image>` resource.
  104. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  105. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  106. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`