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