:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/TextureLayered.xml. .. _class_TextureLayered: TextureLayered ============== **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` **Inherited By:** :ref:`Texture3D`, :ref:`TextureArray` Base class for 3D texture types. Description ----------- Base class for :ref:`Texture3D` and :ref:`TextureArray`. Cannot be used directly, but contains all the functions necessary for accessing and using :ref:`Texture3D` and :ref:`TextureArray`. Data is set on a per-layer basis. For :ref:`Texture3D`\ s, the layer specifies the depth or Z-index, they can be treated as a bunch of 2D slices. Similarly, for :ref:`TextureArray`\ s, the layer specifies the array layer. Properties ---------- +-------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------+ | :ref:`Dictionary` | :ref:`data` | ``{"depth": 0,"flags": 7,"format": 37,"height": 0,"layers": [ ],"width": 0}`` | +-------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------+ | :ref:`int` | :ref:`flags` | ``7`` | +-------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------+ Methods ------- +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_depth` **(** **)** |const| | +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Format` | :ref:`get_format` **(** **)** |const| | +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_height` **(** **)** |const| | +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Image` | :ref:`get_layer_data` **(** :ref:`int` layer **)** |const| | +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_width` **(** **)** |const| | +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_data_partial` **(** :ref:`Image` image, :ref:`int` x_offset, :ref:`int` y_offset, :ref:`int` layer, :ref:`int` mipmap=0 **)** | +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_layer_data` **(** :ref:`Image` image, :ref:`int` layer **)** | +----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Enumerations ------------ .. _enum_TextureLayered_Flags: .. _class_TextureLayered_constant_FLAGS_DEFAULT_TEXTURE_ARRAY: .. _class_TextureLayered_constant_FLAGS_DEFAULT_TEXTURE_3D: .. _class_TextureLayered_constant_FLAG_MIPMAPS: .. _class_TextureLayered_constant_FLAG_REPEAT: .. _class_TextureLayered_constant_FLAG_FILTER: .. _class_TextureLayered_constant_FLAG_ANISOTROPIC_FILTER: enum **Flags**: - **FLAGS_DEFAULT_TEXTURE_ARRAY** = **7** --- Default flags for :ref:`TextureArray`. :ref:`FLAG_MIPMAPS`, :ref:`FLAG_REPEAT` and :ref:`FLAG_FILTER` are enabled. - **FLAGS_DEFAULT_TEXTURE_3D** = **4** --- Default flags for :ref:`Texture3D`. :ref:`FLAG_FILTER` is enabled. - **FLAG_MIPMAPS** = **1** --- Texture will generate mipmaps on creation. - **FLAG_REPEAT** = **2** --- Texture will repeat when UV used is outside the 0-1 range. - **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. - **FLAG_ANISOTROPIC_FILTER** = **8** --- Uses anisotropic mipmap filtering. Generates smaller versions of the same texture with different aspect ratios. This results in better-looking textures when viewed from oblique angles. Property Descriptions --------------------- .. _class_TextureLayered_property_data: - :ref:`Dictionary` **data** +-----------+--------------------------------------------------------------------------------+ | *Default* | ``{"depth": 0,"flags": 7,"format": 37,"height": 0,"layers": [ ],"width": 0}`` | +-----------+--------------------------------------------------------------------------------+ Returns a dictionary with all the data used by this texture. ---- .. _class_TextureLayered_property_flags: - :ref:`int` **flags** +-----------+------------------+ | *Default* | ``7`` | +-----------+------------------+ | *Setter* | set_flags(value) | +-----------+------------------+ | *Getter* | get_flags() | +-----------+------------------+ Specifies which :ref:`Flags` apply to this texture. Method Descriptions ------------------- .. _class_TextureLayered_method_get_depth: - :ref:`int` **get_depth** **(** **)** |const| Returns the depth of the texture. Depth is the 3rd dimension (typically Z-axis). ---- .. _class_TextureLayered_method_get_format: - :ref:`Format` **get_format** **(** **)** |const| Returns the current format being used by this texture. See :ref:`Format` for details. ---- .. _class_TextureLayered_method_get_height: - :ref:`int` **get_height** **(** **)** |const| Returns the height of the texture. Height is typically represented by the Y-axis. ---- .. _class_TextureLayered_method_get_layer_data: - :ref:`Image` **get_layer_data** **(** :ref:`int` layer **)** |const| Returns an :ref:`Image` resource with the data from specified ``layer``. ---- .. _class_TextureLayered_method_get_width: - :ref:`int` **get_width** **(** **)** |const| Returns the width of the texture. Width is typically represented by the X-axis. ---- .. _class_TextureLayered_method_set_data_partial: - void **set_data_partial** **(** :ref:`Image` image, :ref:`int` x_offset, :ref:`int` y_offset, :ref:`int` layer, :ref:`int` mipmap=0 **)** 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` is "stamped" over the texture. The ``image`` must fit within the texture. ---- .. _class_TextureLayered_method_set_layer_data: - void **set_layer_data** **(** :ref:`Image` image, :ref:`int` layer **)** Sets the data for the specified layer. Data takes the form of a 2-dimensional :ref:`Image` resource. .. |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.)`