ImageTexture¶
Inherits: Texture < Resource < Reference < Object
Category: Core
Member Functions¶
void | create ( int width, int height, int format, int flags=null ) |
void | create_from_image ( Image image, int flags=null ) |
int | get_format ( ) const |
float | get_lossy_storage_quality ( ) const |
int | get_storage ( ) const |
void | load ( String path ) |
void | set_data ( Image image ) |
void | set_lossy_storage_quality ( float quality ) |
void | set_size_override ( Vector2 size ) |
void | set_storage ( int mode ) |
Numeric Constants¶
- STORAGE_RAW = 0 — Image data is stored raw and unaltered.
- STORAGE_COMPRESS_LOSSY = 1 — Image data is compressed with a lossy algorithm. You can set the storage quality with set_lossy_storage_quality.
- STORAGE_COMPRESS_LOSSLESS = 2 — Image data is compressed with a lossless algorithm.
Member Function Description¶
Create a new ImageTexture with “width” and “height”.
“format” one of Image.FORMAT_*.
“flags” one or more of Texture.FLAG_*.
Create a new ImageTexture from an Image with “flags” from Texture.FLAG_*.
- int get_format ( ) const
Return the format of the ImageTexture, one of Image.FORMAT_*.
- float get_lossy_storage_quality ( ) const
Return the storage quality for ImageTexture.STORAGE_COMPRESS_LOSSY.
- int get_storage ( ) const
Return the storage type. One of ImageTexture.STORAGE_*.
- void load ( String path )
Load an ImageTexure.
- void normal_to_xy ( )
- void premultiply_alpha ( )
- void set_data ( Image image )
Set the Image of this ImageTexture.
- void set_lossy_storage_quality ( float quality )
Set the storage quality in case of ImageTexture.STORAGE_COMPRESS_LOSSY.
- void set_size_override ( Vector2 size )
- void set_storage ( int mode )
Set the storage type. One of ImageTexture.STORAGE_*.