ImageTexture.xml 3.2 KB

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