Skip to content
0.2.0-dev Download ZIP
114 lines ·4.4 KB Raw
1<?xml version="1.0" encoding="UTF-8" ?>
2<class name="TextureLayered" inherits="Texture" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 Base class for texture types which contain the data of multiple [Image]s. Each image is of the same size and format.
5 </brief_description>
6 <description>
7 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].
8 Data is set on a per-layer basis. For [Texture2DArray]s, the layer specifies the array layer.
9 All images need to have the same width, height and number of mipmap levels.
10 A [TextureLayered] can be loaded with [method ResourceLoader.load].
11 Internally, Godot maps these files to their respective counterparts in the target rendering driver (Vulkan, OpenGL3).
12 </description>
13 <tutorials>
14 </tutorials>
15 <methods>
16 <method name="_get_format" qualifiers="virtual required const">
17 <return type="int" enum="Image.Format" />
18 <description>
19 Called when the [TextureLayered]'s format is queried.
20 </description>
21 </method>
22 <method name="_get_height" qualifiers="virtual required const">
23 <return type="int" />
24 <description>
25 Called when the [TextureLayered]'s height is queried.
26 </description>
27 </method>
28 <method name="_get_layer_data" qualifiers="virtual required const">
29 <return type="Image" />
30 <param index="0" name="layer_index" type="int" />
31 <description>
32 Called when the data for a layer in the [TextureLayered] is queried.
33 </description>
34 </method>
35 <method name="_get_layered_type" qualifiers="virtual required const">
36 <return type="int" />
37 <description>
38 Called when the layers' type in the [TextureLayered] is queried.
39 </description>
40 </method>
41 <method name="_get_layers" qualifiers="virtual required const">
42 <return type="int" />
43 <description>
44 Called when the number of layers in the [TextureLayered] is queried.
45 </description>
46 </method>
47 <method name="_get_width" qualifiers="virtual required const">
48 <return type="int" />
49 <description>
50 Called when the [TextureLayered]'s width queried.
51 </description>
52 </method>
53 <method name="_has_mipmaps" qualifiers="virtual required const">
54 <return type="bool" />
55 <description>
56 Called when the presence of mipmaps in the [TextureLayered] is queried.
57 </description>
58 </method>
59 <method name="get_format" qualifiers="const">
60 <return type="int" enum="Image.Format" />
61 <description>
62 Returns the current format being used by this texture.
63 </description>
64 </method>
65 <method name="get_height" qualifiers="const">
66 <return type="int" />
67 <description>
68 Returns the height of the texture in pixels. Height is typically represented by the Y axis.
69 </description>
70 </method>
71 <method name="get_layer_data" qualifiers="const">
72 <return type="Image" />
73 <param index="0" name="layer" type="int" />
74 <description>
75 Returns an [Image] resource with the data from specified [param layer].
76 </description>
77 </method>
78 <method name="get_layered_type" qualifiers="const">
79 <return type="int" enum="TextureLayered.LayeredType" />
80 <description>
81 Returns the [TextureLayered]'s type. The type determines how the data is accessed, with cubemaps having special types.
82 </description>
83 </method>
84 <method name="get_layers" qualifiers="const">
85 <return type="int" />
86 <description>
87 Returns the number of referenced [Image]s.
88 </description>
89 </method>
90 <method name="get_width" qualifiers="const">
91 <return type="int" />
92 <description>
93 Returns the width of the texture in pixels. Width is typically represented by the X axis.
94 </description>
95 </method>
96 <method name="has_mipmaps" qualifiers="const">
97 <return type="bool" />
98 <description>
99 Returns [code]true[/code] if the layers have generated mipmaps.
100 </description>
101 </method>
102 </methods>
103 <constants>
104 <constant name="LAYERED_TYPE_2D_ARRAY" value="0" enum="LayeredType">
105 Texture is a generic [Texture2DArray].
106 </constant>
107 <constant name="LAYERED_TYPE_CUBEMAP" value="1" enum="LayeredType">
108 Texture is a [Cubemap], with each side in its own layer (6 in total).
109 </constant>
110 <constant name="LAYERED_TYPE_CUBEMAP_ARRAY" value="2" enum="LayeredType">
111 Texture is a [CubemapArray], with each cubemap being made of 6 layers.
112 </constant>
113 </constants>
114</class>