ImageTexture.xml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="ImageTexture" inherits="Texture" category="Core" version="3.1.2">
  3. <brief_description>
  4. A [Texture] based on an [Image].
  5. </brief_description>
  6. <description>
  7. A [Texture] based on an [Image]. Can be created from an [Image] with [method create_from_image].
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="create">
  13. <return type="void">
  14. </return>
  15. <argument index="0" name="width" type="int">
  16. </argument>
  17. <argument index="1" name="height" type="int">
  18. </argument>
  19. <argument index="2" name="format" type="int" enum="Image.Format">
  20. </argument>
  21. <argument index="3" name="flags" type="int" default="7">
  22. </argument>
  23. <description>
  24. Create a new [code]ImageTexture[/code] with [code]width[/code] and [code]height[/code].
  25. [code]format[/code] is a value from [enum Image.Format], [code]flags[/code] is any combination of [enum Texture.Flags].
  26. </description>
  27. </method>
  28. <method name="create_from_image">
  29. <return type="void">
  30. </return>
  31. <argument index="0" name="image" type="Image">
  32. </argument>
  33. <argument index="1" name="flags" type="int" default="7">
  34. </argument>
  35. <description>
  36. Create a new [code]ImageTexture[/code] from an [Image] with [code]flags[/code] from [enum Texture.Flags]. An sRGB to linear color space conversion can take place, according to [enum Image.Format].
  37. </description>
  38. </method>
  39. <method name="get_format" qualifiers="const">
  40. <return type="int" enum="Image.Format">
  41. </return>
  42. <description>
  43. Returns the format of the [code]ImageTexture[/code], one of [enum Image.Format].
  44. </description>
  45. </method>
  46. <method name="load">
  47. <return type="int" enum="Error">
  48. </return>
  49. <argument index="0" name="path" type="String">
  50. </argument>
  51. <description>
  52. Load an [code]ImageTexture[/code] from a file path.
  53. </description>
  54. </method>
  55. <method name="set_data">
  56. <return type="void">
  57. </return>
  58. <argument index="0" name="image" type="Image">
  59. </argument>
  60. <description>
  61. Set the [Image] of this [code]ImageTexture[/code].
  62. </description>
  63. </method>
  64. <method name="set_size_override">
  65. <return type="void">
  66. </return>
  67. <argument index="0" name="size" type="Vector2">
  68. </argument>
  69. <description>
  70. Resizes the [code]ImageTexture[/code] to the specified dimensions.
  71. </description>
  72. </method>
  73. </methods>
  74. <members>
  75. <member name="lossy_quality" type="float" setter="set_lossy_storage_quality" getter="get_lossy_storage_quality">
  76. The storage quality for [constant STORAGE_COMPRESS_LOSSY].
  77. </member>
  78. <member name="storage" type="int" setter="set_storage" getter="get_storage" enum="ImageTexture.Storage">
  79. The storage type (raw, lossy, or compressed).
  80. </member>
  81. </members>
  82. <constants>
  83. <constant name="STORAGE_RAW" value="0" enum="Storage">
  84. [Image] data is stored raw and unaltered.
  85. </constant>
  86. <constant name="STORAGE_COMPRESS_LOSSY" value="1" enum="Storage">
  87. [Image] data is compressed with a lossy algorithm. You can set the storage quality with [member lossy_quality].
  88. </constant>
  89. <constant name="STORAGE_COMPRESS_LOSSLESS" value="2" enum="Storage">
  90. [Image] data is compressed with a lossless algorithm.
  91. </constant>
  92. </constants>
  93. </class>