2018-08-20 22:35:30 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-06 08:08:05 +00:00
<class name= "TextureLayered" inherits= "Texture" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2018-08-20 22:35:30 +00:00
<brief_description >
2022-09-08 08:19:54 +00:00
Base class for texture types which contain the data of multiple [Image]s. Each image is of the same size and format.
2018-08-20 22:35:30 +00:00
</brief_description>
<description >
2023-03-22 21:06:55 +00:00
Base class for [ImageTextureLayered] and [CompressedTextureLayered]. Cannot be used directly, but contains all the functions necessary for accessing the derived resource types. See also [Texture3D].
2022-09-08 08:19:54 +00:00
Data is set on a per-layer basis. For [Texture2DArray]s, the layer specifies the array layer.
All images need to have the same width, height and number of mipmap levels.
2022-10-24 21:19:32 +00:00
A [TextureLayered] can be loaded with [method ResourceLoader.load].
2023-02-03 11:33:17 +00:00
Internally, Godot maps these files to their respective counterparts in the target rendering driver (Vulkan, OpenGL3).
2018-08-20 22:35:30 +00:00
</description>
<tutorials >
</tutorials>
<methods >
2022-03-10 07:17:38 +00:00
<method name= "_get_format" qualifiers= "virtual const" >
<return type= "int" enum= "Image.Format" />
<description >
2022-10-24 21:19:32 +00:00
Called when the [TextureLayered]'s format is queried.
2022-03-10 07:17:38 +00:00
</description>
</method>
<method name= "_get_height" qualifiers= "virtual const" >
<return type= "int" />
<description >
2023-04-17 19:45:30 +00:00
Called when the [TextureLayered]'s height is queried.
2022-03-10 07:17:38 +00:00
</description>
</method>
<method name= "_get_layer_data" qualifiers= "virtual const" >
<return type= "Image" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "layer_index" type= "int" />
2022-03-10 07:17:38 +00:00
<description >
2022-10-24 21:19:32 +00:00
Called when the data for a layer in the [TextureLayered] is queried.
2022-03-10 07:17:38 +00:00
</description>
</method>
<method name= "_get_layered_type" qualifiers= "virtual const" >
<return type= "int" />
<description >
2022-10-24 21:19:32 +00:00
Called when the layers' type in the [TextureLayered] is queried.
2022-03-10 07:17:38 +00:00
</description>
</method>
<method name= "_get_layers" qualifiers= "virtual const" >
<return type= "int" />
<description >
2022-10-24 21:19:32 +00:00
Called when the number of layers in the [TextureLayered] is queried.
2022-03-10 07:17:38 +00:00
</description>
</method>
<method name= "_get_width" qualifiers= "virtual const" >
<return type= "int" />
<description >
2022-10-24 21:19:32 +00:00
Called when the [TextureLayered]'s width queried.
2022-03-10 07:17:38 +00:00
</description>
</method>
<method name= "_has_mipmaps" qualifiers= "virtual const" >
<return type= "bool" />
<description >
2022-10-24 21:19:32 +00:00
Called when the presence of mipmaps in the [TextureLayered] is queried.
2022-03-10 07:17:38 +00:00
</description>
</method>
2018-08-20 22:35:30 +00:00
<method name= "get_format" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" enum= "Image.Format" />
2018-08-20 22:35:30 +00:00
<description >
2020-02-04 20:25:02 +00:00
Returns the current format being used by this texture. See [enum Image.Format] for details.
2018-08-20 22:35:30 +00:00
</description>
</method>
<method name= "get_height" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
2018-08-20 22:35:30 +00:00
<description >
2022-10-24 21:19:32 +00:00
Returns the height of the texture in pixels. Height is typically represented by the Y axis.
2018-08-20 22:35:30 +00:00
</description>
</method>
<method name= "get_layer_data" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "Image" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "layer" type= "int" />
2018-08-20 22:35:30 +00:00
<description >
2022-08-09 15:19:47 +00:00
Returns an [Image] resource with the data from specified [param layer].
2018-08-20 22:35:30 +00:00
</description>
</method>
2020-05-12 08:10:34 +00:00
<method name= "get_layered_type" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" enum= "TextureLayered.LayeredType" />
2020-05-12 08:10:34 +00:00
<description >
2022-10-24 21:19:32 +00:00
Returns the [TextureLayered]'s type. The type determines how the data is accessed, with cubemaps having special types.
2020-05-12 08:10:34 +00:00
</description>
</method>
2020-02-12 08:59:06 +00:00
<method name= "get_layers" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
2018-08-20 22:35:30 +00:00
<description >
2022-09-08 08:19:54 +00:00
Returns the number of referenced [Image]s.
2018-08-20 22:35:30 +00:00
</description>
</method>
2020-02-12 08:59:06 +00:00
<method name= "get_width" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
2018-08-20 22:35:30 +00:00
<description >
2022-10-24 21:19:32 +00:00
Returns the width of the texture in pixels. Width is typically represented by the X axis.
2018-08-20 22:35:30 +00:00
</description>
</method>
2020-05-12 08:10:34 +00:00
<method name= "has_mipmaps" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "bool" />
2018-08-20 22:35:30 +00:00
<description >
2022-09-08 08:19:54 +00:00
Returns [code]true[/code] if the layers have generated mipmaps.
2018-08-20 22:35:30 +00:00
</description>
</method>
</methods>
<constants >
2020-05-12 08:10:34 +00:00
<constant name= "LAYERED_TYPE_2D_ARRAY" value= "0" enum= "LayeredType" >
2022-10-24 21:19:32 +00:00
Texture is a generic [Texture2DArray].
2020-05-12 08:10:34 +00:00
</constant>
<constant name= "LAYERED_TYPE_CUBEMAP" value= "1" enum= "LayeredType" >
2022-10-24 21:19:32 +00:00
Texture is a [Cubemap], with each side in its own layer (6 in total).
2020-05-12 08:10:34 +00:00
</constant>
<constant name= "LAYERED_TYPE_CUBEMAP_ARRAY" value= "2" enum= "LayeredType" >
2022-10-24 21:19:32 +00:00
Texture is a [CubemapArray], with each cubemap being made of 6 layers.
2020-05-12 08:10:34 +00:00
</constant>
2018-08-20 22:35:30 +00:00
</constants>
</class>