ImageTexture

Inherits: Texture < Resource < Reference < Object

A Texture based on an Image.

Description

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

Methods

voidcreate ( int width, int height, Format format, int flags=7 )
voidcreate_from_image ( Image image, int flags=7 )
Formatget_format ( ) const
Errorload ( String path )
voidset_data ( Image image )
voidset_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.

Property Descriptions

Default0.7
Setterset_lossy_storage_quality(value)
Getterget_lossy_storage_quality()

The storage quality for STORAGE_COMPRESS_LOSSY.


Default0
Setterset_storage(value)
Getterget_storage()

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

Method Descriptions

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.


Returns the format of the ImageTexture, one of Format.


Load an ImageTexture from a file path.


  • void set_data ( Image image )

Sets the Image of this ImageTexture.


  • void set_size_override ( Vector2 size )

Resizes the ImageTexture to the specified dimensions.

Doc ID missing

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 1970-01-01 at 00:00:00. It’s the English Stable version because it’s what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.