ImageTexture.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="ImageTexture" inherits="Texture" category="Core" version="3.0.alpha.custom_build">
  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 "width" and "height".
  27. "format" one of [Image].FORMAT_*.
  28. "flags" one or more of [Texture].FLAG_*.
  29. </description>
  30. </method>
  31. <method name="create_from_image">
  32. <return type="void">
  33. </return>
  34. <argument index="0" name="image" type="Image">
  35. </argument>
  36. <argument index="1" name="flags" type="int" default="7">
  37. </argument>
  38. <description>
  39. Create a new [code]ImageTexture[/code] from an [Image] with "flags" from [Texture].FLAG_*.
  40. </description>
  41. </method>
  42. <method name="get_format" qualifiers="const">
  43. <return type="int" enum="Image.Format">
  44. </return>
  45. <description>
  46. Return the format of the [code]ImageTexture[/code], one of [Image].FORMAT_*.
  47. </description>
  48. </method>
  49. <method name="get_lossy_storage_quality" qualifiers="const">
  50. <return type="float">
  51. </return>
  52. <description>
  53. Return the storage quality for [code]ImageTexture[/code].STORAGE_COMPRESS_LOSSY.
  54. </description>
  55. </method>
  56. <method name="get_storage" qualifiers="const">
  57. <return type="int" enum="ImageTexture.Storage">
  58. </return>
  59. <description>
  60. Return the storage type. One of [code]ImageTexture[/code].STORAGE_*.
  61. </description>
  62. </method>
  63. <method name="load">
  64. <return type="void">
  65. </return>
  66. <argument index="0" name="path" type="String">
  67. </argument>
  68. <description>
  69. Load an [code]ImageTexture[/code].
  70. </description>
  71. </method>
  72. <method name="set_data">
  73. <return type="void">
  74. </return>
  75. <argument index="0" name="image" type="Image">
  76. </argument>
  77. <description>
  78. Set the [Image] of this [code]ImageTexture[/code].
  79. </description>
  80. </method>
  81. <method name="set_lossy_storage_quality">
  82. <return type="void">
  83. </return>
  84. <argument index="0" name="quality" type="float">
  85. </argument>
  86. <description>
  87. Set the storage quality in case of [code]ImageTexture[/code].STORAGE_COMPRESS_LOSSY.
  88. </description>
  89. </method>
  90. <method name="set_size_override">
  91. <return type="void">
  92. </return>
  93. <argument index="0" name="size" type="Vector2">
  94. </argument>
  95. <description>
  96. Resizes the [code]ImageTexture[/code] to the specified dimensions.
  97. </description>
  98. </method>
  99. <method name="set_storage">
  100. <return type="void">
  101. </return>
  102. <argument index="0" name="mode" type="int" enum="ImageTexture.Storage">
  103. </argument>
  104. <description>
  105. Set the storage type. One of [code]ImageTexture[/code].STORAGE_*.
  106. </description>
  107. </method>
  108. </methods>
  109. <constants>
  110. <constant name="STORAGE_RAW" value="0">
  111. [Image] data is stored raw and unaltered.
  112. </constant>
  113. <constant name="STORAGE_COMPRESS_LOSSY" value="1">
  114. [Image] data is compressed with a lossy algorithm. You can set the storage quality with [method set_lossy_storage_quality].
  115. </constant>
  116. <constant name="STORAGE_COMPRESS_LOSSLESS" value="2">
  117. [Image] data is compressed with a lossless algorithm.
  118. </constant>
  119. </constants>
  120. </class>