123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- .. 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<class_texture>` **<** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
- **Category:** Core
- Brief Description
- -----------------
- A :ref:`Texture<class_texture>` based on an :ref:`Image<class_image>`.
- Member Functions
- ----------------
- +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`create<class_ImageTexture_create>` **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`int<class_int>` format, :ref:`int<class_int>` flags=7 **)** |
- +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`create_from_image<class_ImageTexture_create_from_image>` **(** :ref:`Image<class_image>` image, :ref:`int<class_int>` flags=7 **)** |
- +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`fix_alpha_edges<class_ImageTexture_fix_alpha_edges>` **(** **)** |
- +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Image<class_image>` | :ref:`get_data<class_ImageTexture_get_data>` **(** **)** const |
- +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_format<class_ImageTexture_get_format>` **(** **)** const |
- +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_lossy_storage_quality<class_ImageTexture_get_lossy_storage_quality>` **(** **)** const |
- +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_storage<class_ImageTexture_get_storage>` **(** **)** const |
- +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`load<class_ImageTexture_load>` **(** :ref:`String<class_string>` path **)** |
- +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`normal_to_xy<class_ImageTexture_normal_to_xy>` **(** **)** |
- +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`premultiply_alpha<class_ImageTexture_premultiply_alpha>` **(** **)** |
- +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_data<class_ImageTexture_set_data>` **(** :ref:`Image<class_image>` image **)** |
- +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_lossy_storage_quality<class_ImageTexture_set_lossy_storage_quality>` **(** :ref:`float<class_float>` quality **)** |
- +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_size_override<class_ImageTexture_set_size_override>` **(** :ref:`Vector2<class_vector2>` size **)** |
- +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_storage<class_ImageTexture_set_storage>` **(** :ref:`int<class_int>` mode **)** |
- +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`shrink_x2_and_keep_size<class_ImageTexture_shrink_x2_and_keep_size>` **(** **)** |
- +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- Numeric Constants
- -----------------
- - **STORAGE_RAW** = **0** --- :ref:`Image<class_image>` data is stored raw and unaltered.
- - **STORAGE_COMPRESS_LOSSY** = **1** --- :ref:`Image<class_image>` data is compressed with a lossy algorithm. You can set the storage quality with :ref:`set_lossy_storage_quality<class_ImageTexture_set_lossy_storage_quality>`.
- - **STORAGE_COMPRESS_LOSSLESS** = **2** --- :ref:`Image<class_image>` data is compressed with a lossless algorithm.
- Description
- -----------
- A :ref:`Texture<class_texture>` based on an :ref:`Image<class_image>`. Can be created from an :ref:`Image<class_image>`.
- Member Function Description
- ---------------------------
- .. _class_ImageTexture_create:
- - void **create** **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`int<class_int>` format, :ref:`int<class_int>` flags=7 **)**
- Create a new :ref:`ImageTexture<class_imagetexture>` with "width" and "height".
- "format" one of :ref:`Image<class_image>`.FORMAT\_\*.
- "flags" one or more of :ref:`Texture<class_texture>`.FLAG\_\*.
- .. _class_ImageTexture_create_from_image:
- - void **create_from_image** **(** :ref:`Image<class_image>` image, :ref:`int<class_int>` flags=7 **)**
- Create a new :ref:`ImageTexture<class_imagetexture>` from an :ref:`Image<class_image>` with "flags" from :ref:`Texture<class_texture>`.FLAG\_\*.
- .. _class_ImageTexture_fix_alpha_edges:
- - void **fix_alpha_edges** **(** **)**
- .. _class_ImageTexture_get_data:
- - :ref:`Image<class_image>` **get_data** **(** **)** const
- Return the :ref:`Image<class_image>` of this :ref:`ImageTexture<class_imagetexture>`.
- .. _class_ImageTexture_get_format:
- - :ref:`int<class_int>` **get_format** **(** **)** const
- Return the format of the :ref:`ImageTexture<class_imagetexture>`, one of :ref:`Image<class_image>`.FORMAT\_\*.
- .. _class_ImageTexture_get_lossy_storage_quality:
- - :ref:`float<class_float>` **get_lossy_storage_quality** **(** **)** const
- Return the storage quality for :ref:`ImageTexture<class_imagetexture>`.STORAGE_COMPRESS_LOSSY.
- .. _class_ImageTexture_get_storage:
- - :ref:`int<class_int>` **get_storage** **(** **)** const
- Return the storage type. One of :ref:`ImageTexture<class_imagetexture>`.STORAGE\_\*.
- .. _class_ImageTexture_load:
- - void **load** **(** :ref:`String<class_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<class_image>` image **)**
- Set the :ref:`Image<class_image>` of this :ref:`ImageTexture<class_imagetexture>`.
- .. _class_ImageTexture_set_lossy_storage_quality:
- - void **set_lossy_storage_quality** **(** :ref:`float<class_float>` quality **)**
- Set the storage quality in case of :ref:`ImageTexture<class_imagetexture>`.STORAGE_COMPRESS_LOSSY.
- .. _class_ImageTexture_set_size_override:
- - void **set_size_override** **(** :ref:`Vector2<class_vector2>` size **)**
- .. _class_ImageTexture_set_storage:
- - void **set_storage** **(** :ref:`int<class_int>` mode **)**
- Set the storage type. One of :ref:`ImageTexture<class_imagetexture>`.STORAGE\_\*.
- .. _class_ImageTexture_shrink_x2_and_keep_size:
- - void **shrink_x2_and_keep_size** **(** **)**
|