summaryrefslogtreecommitdiff
path: root/doc/classes/ImageTexture.xml
blob: d179794c1f62a50a115e225fa9c647e9d0dd56c6 (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
115
116
117
118
119
120
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ImageTexture" inherits="Texture" category="Core" version="3.0-alpha">
	<brief_description>
		A [Texture] based on an [Image].
	</brief_description>
	<description>
		A [Texture] based on an [Image]. Can be created from an [Image] with [method create_from_image].
	</description>
	<tutorials>
	</tutorials>
	<demos>
	</demos>
	<methods>
		<method name="create">
			<return type="void">
			</return>
			<argument index="0" name="width" type="int">
			</argument>
			<argument index="1" name="height" type="int">
			</argument>
			<argument index="2" name="format" type="int" enum="Image.Format">
			</argument>
			<argument index="3" name="flags" type="int" default="7">
			</argument>
			<description>
				Create a new [code]ImageTexture[/code] with "width" and "height".
				"format" one of [Image].FORMAT_*.
				"flags" one or more of [Texture].FLAG_*.
			</description>
		</method>
		<method name="create_from_image">
			<return type="void">
			</return>
			<argument index="0" name="image" type="Image">
			</argument>
			<argument index="1" name="flags" type="int" default="7">
			</argument>
			<description>
				Create a new [code]ImageTexture[/code] from an [Image] with "flags" from [Texture].FLAG_*.
			</description>
		</method>
		<method name="get_format" qualifiers="const">
			<return type="int" enum="Image.Format">
			</return>
			<description>
				Return the format of the [code]ImageTexture[/code], one of [Image].FORMAT_*.
			</description>
		</method>
		<method name="get_lossy_storage_quality" qualifiers="const">
			<return type="float">
			</return>
			<description>
				Return the storage quality for [code]ImageTexture[/code].STORAGE_COMPRESS_LOSSY.
			</description>
		</method>
		<method name="get_storage" qualifiers="const">
			<return type="int" enum="ImageTexture.Storage">
			</return>
			<description>
				Return the storage type. One of [code]ImageTexture[/code].STORAGE_*.
			</description>
		</method>
		<method name="load">
			<return type="void">
			</return>
			<argument index="0" name="path" type="String">
			</argument>
			<description>
				Load an [code]ImageTexture[/code].
			</description>
		</method>
		<method name="set_data">
			<return type="void">
			</return>
			<argument index="0" name="image" type="Image">
			</argument>
			<description>
				Set the [Image] of this [code]ImageTexture[/code].
			</description>
		</method>
		<method name="set_lossy_storage_quality">
			<return type="void">
			</return>
			<argument index="0" name="quality" type="float">
			</argument>
			<description>
				Set the storage quality in case of [code]ImageTexture[/code].STORAGE_COMPRESS_LOSSY.
			</description>
		</method>
		<method name="set_size_override">
			<return type="void">
			</return>
			<argument index="0" name="size" type="Vector2">
			</argument>
			<description>
				Resizes the [code]ImageTexture[/code] to the specified dimensions.
			</description>
		</method>
		<method name="set_storage">
			<return type="void">
			</return>
			<argument index="0" name="mode" type="int" enum="ImageTexture.Storage">
			</argument>
			<description>
				Set the storage type. One of [code]ImageTexture[/code].STORAGE_*.
			</description>
		</method>
	</methods>
	<constants>
		<constant name="STORAGE_RAW" value="0">
			[Image] data is stored raw and unaltered.
		</constant>
		<constant name="STORAGE_COMPRESS_LOSSY" value="1">
			[Image] data is compressed with a lossy algorithm. You can set the storage quality with [method set_lossy_storage_quality].
		</constant>
		<constant name="STORAGE_COMPRESS_LOSSLESS" value="2">
			[Image] data is compressed with a lossless algorithm.
		</constant>
	</constants>
</class>