.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_ImageTexture: ImageTexture ============ **Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` **Category:** Core Brief Description ----------------- A :ref:`Texture` based on an :ref:`Image`. Member Functions ---------------- +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`create` **(** :ref:`int` width, :ref:`int` height, :ref:`int` format, :ref:`int` flags=null **)** | +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`create_from_image` **(** :ref:`Image` image, :ref:`int` flags=null **)** | +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_format` **(** **)** const | +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_lossy_storage_quality` **(** **)** const | +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_storage` **(** **)** const | +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`load` **(** :ref:`String` path **)** | +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_data` **(** :ref:`Image` image **)** | +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_lossy_storage_quality` **(** :ref:`float` quality **)** | +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_size_override` **(** :ref:`Vector2` size **)** | +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_storage` **(** :ref:`int` mode **)** | +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Numeric Constants ----------------- - **STORAGE_RAW** = **0** --- :ref:`Image` data is stored raw and unaltered. - **STORAGE_COMPRESS_LOSSY** = **1** --- :ref:`Image` data is compressed with a lossy algorithm. You can set the storage quality with :ref:`set_lossy_storage_quality`. - **STORAGE_COMPRESS_LOSSLESS** = **2** --- :ref:`Image` data is compressed with a lossless algorithm. Description ----------- A :ref:`Texture` based on an :ref:`Image`. Can be created from an :ref:`Image`. Member Function Description --------------------------- .. _class_ImageTexture_create: - void **create** **(** :ref:`int` width, :ref:`int` height, :ref:`int` format, :ref:`int` flags=null **)** Create a new :ref:`ImageTexture` with "width" and "height". "format" one of :ref:`Image`.FORMAT\_\*. "flags" one or more of :ref:`Texture`.FLAG\_\*. .. _class_ImageTexture_create_from_image: - void **create_from_image** **(** :ref:`Image` image, :ref:`int` flags=null **)** Create a new :ref:`ImageTexture` from an :ref:`Image` with "flags" from :ref:`Texture`.FLAG\_\*. .. _class_ImageTexture_get_format: - :ref:`int` **get_format** **(** **)** const Return the format of the :ref:`ImageTexture`, one of :ref:`Image`.FORMAT\_\*. .. _class_ImageTexture_get_lossy_storage_quality: - :ref:`float` **get_lossy_storage_quality** **(** **)** const Return the storage quality for :ref:`ImageTexture`.STORAGE_COMPRESS_LOSSY. .. _class_ImageTexture_get_storage: - :ref:`int` **get_storage** **(** **)** const Return the storage type. One of :ref:`ImageTexture`.STORAGE\_\*. .. _class_ImageTexture_load: - void **load** **(** :ref:`String` path **)** Load an ImageTexure. .. _class_ImageTexture_normal_to_xy: - void **normal_to_xy** **(** **)** .. _class_ImageTexture_premultiply_alpha: - void **premultiply_alpha** **(** **)** .. _class_ImageTexture_set_data: - void **set_data** **(** :ref:`Image` image **)** Set the :ref:`Image` of this :ref:`ImageTexture`. .. _class_ImageTexture_set_lossy_storage_quality: - void **set_lossy_storage_quality** **(** :ref:`float` quality **)** Set the storage quality in case of :ref:`ImageTexture`.STORAGE_COMPRESS_LOSSY. .. _class_ImageTexture_set_size_override: - void **set_size_override** **(** :ref:`Vector2` size **)** .. _class_ImageTexture_set_storage: - void **set_storage** **(** :ref:`int` mode **)** Set the storage type. One of :ref:`ImageTexture`.STORAGE\_\*.