2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2019-04-01 10:33:56 +00:00
<class name= "ImageTexture" inherits= "Texture" category= "Core" version= "3.2" >
2017-09-12 20:42:36 +00:00
<brief_description >
A [Texture] based on an [Image].
</brief_description>
<description >
2017-10-09 10:49:12 +00:00
A [Texture] based on an [Image]. Can be created from an [Image] with [method create_from_image].
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
</tutorials>
<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 >
2019-03-29 22:37:35 +00:00
Create a new [ImageTexture] with [code]width[/code] and [code]height[/code].
2018-12-28 23:17:09 +00:00
[code]format[/code] is a value from [enum Image.Format], [code]flags[/code] is any combination of [enum Texture.Flags].
2017-09-12 20:42:36 +00:00
</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 >
2019-03-29 22:37:35 +00:00
Create a new [ImageTexture] from an [Image] with [code]flags[/code] from [enum Texture.Flags]. An sRGB to linear color space conversion can take place, according to [enum Image.Format].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_format" qualifiers= "const" >
<return type= "int" enum= "Image.Format" >
</return>
<description >
2019-05-24 02:15:43 +00:00
Returns the format of the [ImageTexture], one of [enum Image.Format].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "load" >
2018-05-12 14:53:45 +00:00
<return type= "int" enum= "Error" >
2017-09-12 20:42:36 +00:00
</return>
<argument index= "0" name= "path" type= "String" >
</argument>
<description >
2019-03-29 22:37:35 +00:00
Load an [ImageTexture] from a file path.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_data" >
<return type= "void" >
</return>
<argument index= "0" name= "image" type= "Image" >
</argument>
<description >
2019-06-21 23:04:47 +00:00
Sets the [Image] of this [ImageTexture].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "set_size_override" >
<return type= "void" >
</return>
<argument index= "0" name= "size" type= "Vector2" >
</argument>
<description >
2019-03-29 22:37:35 +00:00
Resizes the [ImageTexture] to the specified dimensions.
2017-09-12 20:42:36 +00:00
</description>
</method>
</methods>
2018-01-11 22:38:35 +00:00
<members >
2019-09-24 11:34:03 +00:00
<member name= "flags" type= "int" setter= "set_flags" getter= "get_flags" override= "true" default= "7" />
2019-06-29 10:38:01 +00:00
<member name= "lossy_quality" type= "float" setter= "set_lossy_storage_quality" getter= "get_lossy_storage_quality" default= "0.7" >
2019-06-27 10:34:26 +00:00
The storage quality for [constant STORAGE_COMPRESS_LOSSY].
2018-01-11 22:38:35 +00:00
</member>
2019-06-29 10:38:01 +00:00
<member name= "storage" type= "int" setter= "set_storage" getter= "get_storage" enum= "ImageTexture.Storage" default= "0" >
2018-01-11 22:38:35 +00:00
The storage type (raw, lossy, or compressed).
</member>
</members>
2017-09-12 20:42:36 +00:00
<constants >
2017-11-24 22:16:30 +00:00
<constant name= "STORAGE_RAW" value= "0" enum= "Storage" >
2017-09-12 20:42:36 +00:00
[Image] data is stored raw and unaltered.
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "STORAGE_COMPRESS_LOSSY" value= "1" enum= "Storage" >
2018-12-28 23:17:09 +00:00
[Image] data is compressed with a lossy algorithm. You can set the storage quality with [member lossy_quality].
2017-09-12 20:42:36 +00:00
</constant>
2017-11-24 22:16:30 +00:00
<constant name= "STORAGE_COMPRESS_LOSSLESS" value= "2" enum= "Storage" >
2017-09-12 20:42:36 +00:00
[Image] data is compressed with a lossless algorithm.
</constant>
</constants>
</class>