File: Texture.xml

package info (click to toggle)
godot 3.6%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 270,588 kB
  • sloc: cpp: 971,579; ansic: 617,953; xml: 80,302; asm: 17,498; cs: 14,559; python: 11,744; java: 9,681; javascript: 4,654; pascal: 1,176; sh: 896; objc: 529; makefile: 176
file content (116 lines) | stat: -rw-r--r-- 5,451 bytes parent folder | download | duplicates (2)
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
115
116
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Texture" inherits="Resource" version="3.6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
	<brief_description>
		Texture for 2D and 3D.
	</brief_description>
	<description>
		A texture works by registering an image in the video hardware, which then can be used in 3D models or 2D [Sprite] or GUI [Control].
		Textures are often created by loading them from a file. See [method @GDScript.load].
		[Texture] is a base for other resources. It cannot be used directly.
		[b]Note:[/b] The maximum texture size is 16384×16384 pixels due to graphics hardware limitations. Larger textures may fail to import.
	</description>
	<tutorials>
	</tutorials>
	<methods>
		<method name="draw" qualifiers="const">
			<return type="void" />
			<argument index="0" name="canvas_item" type="RID" />
			<argument index="1" name="position" type="Vector2" />
			<argument index="2" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )" />
			<argument index="3" name="transpose" type="bool" default="false" />
			<argument index="4" name="normal_map" type="Texture" default="null" />
			<description>
				Draws the texture using a [CanvasItem] with the [VisualServer] API at the specified [code]position[/code]. Equivalent to [method VisualServer.canvas_item_add_texture_rect] with a rect at [code]position[/code] and the size of this [Texture].
			</description>
		</method>
		<method name="draw_rect" qualifiers="const">
			<return type="void" />
			<argument index="0" name="canvas_item" type="RID" />
			<argument index="1" name="rect" type="Rect2" />
			<argument index="2" name="tile" type="bool" />
			<argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )" />
			<argument index="4" name="transpose" type="bool" default="false" />
			<argument index="5" name="normal_map" type="Texture" default="null" />
			<description>
				Draws the texture using a [CanvasItem] with the [VisualServer] API. Equivalent to [method VisualServer.canvas_item_add_texture_rect].
			</description>
		</method>
		<method name="draw_rect_region" qualifiers="const">
			<return type="void" />
			<argument index="0" name="canvas_item" type="RID" />
			<argument index="1" name="rect" type="Rect2" />
			<argument index="2" name="src_rect" type="Rect2" />
			<argument index="3" name="modulate" type="Color" default="Color( 1, 1, 1, 1 )" />
			<argument index="4" name="transpose" type="bool" default="false" />
			<argument index="5" name="normal_map" type="Texture" default="null" />
			<argument index="6" name="clip_uv" type="bool" default="true" />
			<description>
				Draws a part of the texture using a [CanvasItem] with the [VisualServer] API. Equivalent to [method VisualServer.canvas_item_add_texture_rect_region].
			</description>
		</method>
		<method name="get_data" qualifiers="const">
			<return type="Image" />
			<description>
				Returns an [Image] that is a copy of data from this [Texture]. [Image]s can be accessed and manipulated directly.
			</description>
		</method>
		<method name="get_height" qualifiers="const">
			<return type="int" />
			<description>
				Returns the texture height.
			</description>
		</method>
		<method name="get_size" qualifiers="const">
			<return type="Vector2" />
			<description>
				Returns the texture size.
			</description>
		</method>
		<method name="get_width" qualifiers="const">
			<return type="int" />
			<description>
				Returns the texture width.
			</description>
		</method>
		<method name="has_alpha" qualifiers="const">
			<return type="bool" />
			<description>
				Returns [code]true[/code] if this [Texture] has an alpha channel.
			</description>
		</method>
	</methods>
	<members>
		<member name="flags" type="int" setter="set_flags" getter="get_flags" default="4">
			The texture's [enum Flags]. [enum Flags] are used to set various properties of the [Texture].
		</member>
	</members>
	<constants>
		<constant name="FLAGS_DEFAULT" value="7" enum="Flags">
			Default flags. [constant FLAG_MIPMAPS], [constant FLAG_REPEAT] and [constant FLAG_FILTER] are enabled.
		</constant>
		<constant name="FLAG_MIPMAPS" value="1" enum="Flags">
			Generates mipmaps, which are smaller versions of the same texture to use when zoomed out, keeping the aspect ratio.
		</constant>
		<constant name="FLAG_REPEAT" value="2" enum="Flags">
			Repeats the texture (instead of clamp to edge).
			[b]Note:[/b] Ignored when using an [AtlasTexture] as these don't support repetition.
		</constant>
		<constant name="FLAG_FILTER" value="4" enum="Flags">
			Uses a magnifying filter, to enable smooth zooming in of the texture.
		</constant>
		<constant name="FLAG_ANISOTROPIC_FILTER" value="8" enum="Flags">
			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.
		</constant>
		<constant name="FLAG_CONVERT_TO_LINEAR" value="16" enum="Flags">
			Converts the texture to the sRGB color space.
		</constant>
		<constant name="FLAG_MIRRORED_REPEAT" value="32" enum="Flags">
			Repeats the texture with alternate sections mirrored.
			[b]Note:[/b] Ignored when using an [AtlasTexture] as these don't support repetition.
		</constant>
		<constant name="FLAG_VIDEO_SURFACE" value="2048" enum="Flags">
			Texture is a video surface.
		</constant>
	</constants>
</class>