class_imagetexture.rst 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the ImageTexture.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_ImageTexture:
  5. ImageTexture
  6. ============
  7. **Inherits:** :ref:`Texture<class_texture>` **<** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. A :ref:`Texture<class_texture>` based on an :ref:`Image<class_image>`.
  12. Member Functions
  13. ----------------
  14. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | 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 **)** |
  16. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`create_from_image<class_ImageTexture_create_from_image>` **(** :ref:`Image<class_image>` image, :ref:`int<class_int>` flags=7 **)** |
  18. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`int<class_int>` | :ref:`get_format<class_ImageTexture_get_format>` **(** **)** const |
  20. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`float<class_float>` | :ref:`get_lossy_storage_quality<class_ImageTexture_get_lossy_storage_quality>` **(** **)** const |
  22. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`int<class_int>` | :ref:`get_storage<class_ImageTexture_get_storage>` **(** **)** const |
  24. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`load<class_ImageTexture_load>` **(** :ref:`String<class_string>` path **)** |
  26. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`set_data<class_ImageTexture_set_data>` **(** :ref:`Image<class_image>` image **)** |
  28. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`set_lossy_storage_quality<class_ImageTexture_set_lossy_storage_quality>` **(** :ref:`float<class_float>` quality **)** |
  30. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`set_size_override<class_ImageTexture_set_size_override>` **(** :ref:`Vector2<class_vector2>` size **)** |
  32. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`set_storage<class_ImageTexture_set_storage>` **(** :ref:`int<class_int>` mode **)** |
  34. +----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. Numeric Constants
  36. -----------------
  37. - **STORAGE_RAW** = **0** --- :ref:`Image<class_image>` data is stored raw and unaltered.
  38. - **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>`.
  39. - **STORAGE_COMPRESS_LOSSLESS** = **2** --- :ref:`Image<class_image>` data is compressed with a lossless algorithm.
  40. Description
  41. -----------
  42. A :ref:`Texture<class_texture>` based on an :ref:`Image<class_image>`. Can be created from an :ref:`Image<class_image>` with :ref:`create_from_image<class_ImageTexture_create_from_image>`.
  43. Member Function Description
  44. ---------------------------
  45. .. _class_ImageTexture_create:
  46. - void **create** **(** :ref:`int<class_int>` width, :ref:`int<class_int>` height, :ref:`int<class_int>` format, :ref:`int<class_int>` flags=7 **)**
  47. Create a new :ref:`ImageTexture<class_imagetexture>` with "width" and "height".
  48. "format" one of :ref:`Image<class_image>`.FORMAT\_\*.
  49. "flags" one or more of :ref:`Texture<class_texture>`.FLAG\_\*.
  50. .. _class_ImageTexture_create_from_image:
  51. - void **create_from_image** **(** :ref:`Image<class_image>` image, :ref:`int<class_int>` flags=7 **)**
  52. Create a new :ref:`ImageTexture<class_imagetexture>` from an :ref:`Image<class_image>` with "flags" from :ref:`Texture<class_texture>`.FLAG\_\*.
  53. .. _class_ImageTexture_get_format:
  54. - :ref:`int<class_int>` **get_format** **(** **)** const
  55. Return the format of the :ref:`ImageTexture<class_imagetexture>`, one of :ref:`Image<class_image>`.FORMAT\_\*.
  56. .. _class_ImageTexture_get_lossy_storage_quality:
  57. - :ref:`float<class_float>` **get_lossy_storage_quality** **(** **)** const
  58. Return the storage quality for :ref:`ImageTexture<class_imagetexture>`.STORAGE_COMPRESS_LOSSY.
  59. .. _class_ImageTexture_get_storage:
  60. - :ref:`int<class_int>` **get_storage** **(** **)** const
  61. Return the storage type. One of :ref:`ImageTexture<class_imagetexture>`.STORAGE\_\*.
  62. .. _class_ImageTexture_load:
  63. - void **load** **(** :ref:`String<class_string>` path **)**
  64. Load an :ref:`ImageTexture<class_imagetexture>`.
  65. .. _class_ImageTexture_set_data:
  66. - void **set_data** **(** :ref:`Image<class_image>` image **)**
  67. Set the :ref:`Image<class_image>` of this :ref:`ImageTexture<class_imagetexture>`.
  68. .. _class_ImageTexture_set_lossy_storage_quality:
  69. - void **set_lossy_storage_quality** **(** :ref:`float<class_float>` quality **)**
  70. Set the storage quality in case of :ref:`ImageTexture<class_imagetexture>`.STORAGE_COMPRESS_LOSSY.
  71. .. _class_ImageTexture_set_size_override:
  72. - void **set_size_override** **(** :ref:`Vector2<class_vector2>` size **)**
  73. Resizes the ``ImageTexture`` to the specified dimensions.
  74. .. _class_ImageTexture_set_storage:
  75. - void **set_storage** **(** :ref:`int<class_int>` mode **)**
  76. Set the storage type. One of :ref:`ImageTexture<class_imagetexture>`.STORAGE\_\*.