TextureLayered.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="TextureLayered" inherits="Resource" version="3.4">
  3. <brief_description>
  4. Base class for 3D texture types.
  5. </brief_description>
  6. <description>
  7. Base class for [Texture3D] and [TextureArray]. Cannot be used directly, but contains all the functions necessary for accessing and using [Texture3D] and [TextureArray]. Data is set on a per-layer basis. For [Texture3D]s, the layer specifies the depth or Z-index, they can be treated as a bunch of 2D slices. Similarly, for [TextureArray]s, the layer specifies the array layer.
  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="depth" type="int">
  20. </argument>
  21. <argument index="3" name="format" type="int" enum="Image.Format">
  22. </argument>
  23. <argument index="4" name="flags" type="int" default="4">
  24. </argument>
  25. <description>
  26. Creates the [Texture3D] or [TextureArray] with specified [code]width[/code], [code]height[/code], and [code]depth[/code]. See [enum Image.Format] for [code]format[/code] options. See [enum Flags] enumerator for [code]flags[/code] options.
  27. </description>
  28. </method>
  29. <method name="get_depth" qualifiers="const">
  30. <return type="int">
  31. </return>
  32. <description>
  33. Returns the depth of the texture. Depth is the 3rd dimension (typically Z-axis).
  34. </description>
  35. </method>
  36. <method name="get_format" qualifiers="const">
  37. <return type="int" enum="Image.Format">
  38. </return>
  39. <description>
  40. Returns the current format being used by this texture. See [enum Image.Format] for details.
  41. </description>
  42. </method>
  43. <method name="get_height" qualifiers="const">
  44. <return type="int">
  45. </return>
  46. <description>
  47. Returns the height of the texture. Height is typically represented by the Y-axis.
  48. </description>
  49. </method>
  50. <method name="get_layer_data" qualifiers="const">
  51. <return type="Image">
  52. </return>
  53. <argument index="0" name="layer" type="int">
  54. </argument>
  55. <description>
  56. Returns an [Image] resource with the data from specified [code]layer[/code].
  57. </description>
  58. </method>
  59. <method name="get_width" qualifiers="const">
  60. <return type="int">
  61. </return>
  62. <description>
  63. Returns the width of the texture. Width is typically represented by the X-axis.
  64. </description>
  65. </method>
  66. <method name="set_data_partial">
  67. <return type="void">
  68. </return>
  69. <argument index="0" name="image" type="Image">
  70. </argument>
  71. <argument index="1" name="x_offset" type="int">
  72. </argument>
  73. <argument index="2" name="y_offset" type="int">
  74. </argument>
  75. <argument index="3" name="layer" type="int">
  76. </argument>
  77. <argument index="4" name="mipmap" type="int" default="0">
  78. </argument>
  79. <description>
  80. Partially sets the data for a specified [code]layer[/code] by overwriting using the data of the specified [code]image[/code]. [code]x_offset[/code] and [code]y_offset[/code] determine where the [Image] is "stamped" over the texture. The [code]image[/code] must fit within the texture.
  81. </description>
  82. </method>
  83. <method name="set_layer_data">
  84. <return type="void">
  85. </return>
  86. <argument index="0" name="image" type="Image">
  87. </argument>
  88. <argument index="1" name="layer" type="int">
  89. </argument>
  90. <description>
  91. Sets the data for the specified layer. Data takes the form of a 2-dimensional [Image] resource.
  92. </description>
  93. </method>
  94. </methods>
  95. <members>
  96. <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" default="{&quot;depth&quot;: 0,&quot;flags&quot;: 4,&quot;format&quot;: 37,&quot;height&quot;: 0,&quot;layers&quot;: [ ],&quot;width&quot;: 0}">
  97. Returns a dictionary with all the data used by this texture.
  98. </member>
  99. <member name="flags" type="int" setter="set_flags" getter="get_flags" default="4">
  100. Specifies which [enum Flags] apply to this texture.
  101. </member>
  102. </members>
  103. <constants>
  104. <constant name="FLAG_MIPMAPS" value="1" enum="Flags">
  105. Texture will generate mipmaps on creation.
  106. </constant>
  107. <constant name="FLAG_REPEAT" value="2" enum="Flags">
  108. Texture will repeat when UV used is outside the 0-1 range.
  109. </constant>
  110. <constant name="FLAG_FILTER" value="4" enum="Flags">
  111. Use filtering when reading from texture. Filtering smooths out pixels. Turning filtering off is slightly faster and more appropriate when you need access to individual pixels.
  112. </constant>
  113. <constant name="FLAGS_DEFAULT" value="4" enum="Flags">
  114. Equivalent to [constant FLAG_FILTER].
  115. </constant>
  116. </constants>
  117. </class>