W3cubDocs

/Godot 3.1

ImageTexture

Inherits: Texture < Resource < Reference < Object

Category: Core

Brief Description

A Texture based on an Image.

Properties

float lossy_quality
Storage storage

Methods

void create ( int width, int height, Format format, int flags=7 )
void create_from_image ( Image image, int flags=7 )
Format get_format ( ) const
Error load ( String path )
void set_data ( Image image )
void set_size_override ( Vector2 size )

Enumerations

enum Storage:

  • STORAGE_RAW = 0Image data is stored raw and unaltered.
  • STORAGE_COMPRESS_LOSSY = 1Image data is compressed with a lossy algorithm. You can set the storage quality with lossy_quality.
  • STORAGE_COMPRESS_LOSSLESS = 2Image data is compressed with a lossless algorithm.

Description

A Texture based on an Image. Can be created from an Image with create_from_image.

Property Descriptions

float lossy_quality

Setter set_lossy_storage_quality(value)
Getter get_lossy_storage_quality()

The storage quality for STORAGE_COMPRESS_LOSSY.

Storage storage

Setter set_storage(value)
Getter get_storage()

The storage type (raw, lossy, or compressed).

Method Descriptions

void create ( int width, int height, Format format, int flags=7 )

Create a new ImageTexture with width and height.

format is a value from Format, flags is any combination of Flags.

void create_from_image ( Image image, int flags=7 )

Create a new ImageTexture from an Image with flags from Flags. An sRGB to linear color space conversion can take place, according to Format.

Format get_format ( ) const

Returns the format of the ImageTexture, one of Format.

Error load ( String path )

Load an ImageTexture from a file path.

void set_data ( Image image )

Set the Image of this ImageTexture.

void set_size_override ( Vector2 size )

Resizes the ImageTexture to the specified dimensions.

© 2014–2019 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
http://docs.godotengine.org/en/3.1/classes/class_imagetexture.html