.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the ImageTexture.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _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=7 **)** | +------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`create_from_image` **(** :ref:`Image` image, :ref:`int` flags=7 **)** | +------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_format` **(** **)** const | +------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`load` **(** :ref:`String` path **)** | +------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_data` **(** :ref:`Image` image **)** | +------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_size_override` **(** :ref:`Vector2` size **)** | +------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Member Variables ---------------- .. _class_ImageTexture_lossy_quality: - :ref:`float` **lossy_quality** - The storage quality for ``ImageTexture``.STORAGE_COMPRESS_LOSSY. .. _class_ImageTexture_storage: - :ref:`Storage` **storage** - The storage type (raw, lossy, or compressed). Enums ----- .. _enum_ImageTexture_Storage: enum **Storage** - **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` with :ref:`create_from_image`. Member Function Description --------------------------- .. _class_ImageTexture_create: - void **create** **(** :ref:`int` width, :ref:`int` height, :ref:`int` format, :ref:`int` flags=7 **)** Create a new ``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=7 **)** Create a new ``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 ``ImageTexture``, one of :ref:`Image`.FORMAT\_\*. .. _class_ImageTexture_load: - void **load** **(** :ref:`String` path **)** Load an ``ImageTexture``. .. _class_ImageTexture_set_data: - void **set_data** **(** :ref:`Image` image **)** Set the :ref:`Image` of this ``ImageTexture``. .. _class_ImageTexture_set_size_override: - void **set_size_override** **(** :ref:`Vector2` size **)** Resizes the ``ImageTexture`` to the specified dimensions.