Polygon2D.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Polygon2D" inherits="Node2D" version="3.4">
  3. <brief_description>
  4. A 2D polygon.
  5. </brief_description>
  6. <description>
  7. A Polygon2D is defined by a set of points. Each point is connected to the next, with the final point being connected to the first, resulting in a closed polygon. Polygon2Ds can be filled with color (solid or gradient) or filled with a given texture.
  8. [b]Note:[/b] By default, Godot can only draw up to 4,096 polygon points at a time. To increase this limit, open the Project Settings and increase [member ProjectSettings.rendering/limits/buffers/canvas_polygon_buffer_size_kb] and [member ProjectSettings.rendering/limits/buffers/canvas_polygon_index_buffer_size_kb].
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <methods>
  13. <method name="add_bone">
  14. <return type="void">
  15. </return>
  16. <argument index="0" name="path" type="NodePath">
  17. </argument>
  18. <argument index="1" name="weights" type="PoolRealArray">
  19. </argument>
  20. <description>
  21. Adds a bone with the specified [code]path[/code] and [code]weights[/code].
  22. </description>
  23. </method>
  24. <method name="clear_bones">
  25. <return type="void">
  26. </return>
  27. <description>
  28. Removes all bones from this [Polygon2D].
  29. </description>
  30. </method>
  31. <method name="erase_bone">
  32. <return type="void">
  33. </return>
  34. <argument index="0" name="index" type="int">
  35. </argument>
  36. <description>
  37. Removes the specified bone from this [Polygon2D].
  38. </description>
  39. </method>
  40. <method name="get_bone_count" qualifiers="const">
  41. <return type="int">
  42. </return>
  43. <description>
  44. Returns the number of bones in this [Polygon2D].
  45. </description>
  46. </method>
  47. <method name="get_bone_path" qualifiers="const">
  48. <return type="NodePath">
  49. </return>
  50. <argument index="0" name="index" type="int">
  51. </argument>
  52. <description>
  53. Returns the path to the node associated with the specified bone.
  54. </description>
  55. </method>
  56. <method name="get_bone_weights" qualifiers="const">
  57. <return type="PoolRealArray">
  58. </return>
  59. <argument index="0" name="index" type="int">
  60. </argument>
  61. <description>
  62. Returns the height values of the specified bone.
  63. </description>
  64. </method>
  65. <method name="set_bone_path">
  66. <return type="void">
  67. </return>
  68. <argument index="0" name="index" type="int">
  69. </argument>
  70. <argument index="1" name="path" type="NodePath">
  71. </argument>
  72. <description>
  73. Sets the path to the node associated with the specified bone.
  74. </description>
  75. </method>
  76. <method name="set_bone_weights">
  77. <return type="void">
  78. </return>
  79. <argument index="0" name="index" type="int">
  80. </argument>
  81. <argument index="1" name="weights" type="PoolRealArray">
  82. </argument>
  83. <description>
  84. Sets the weight values for the specified bone.
  85. </description>
  86. </method>
  87. </methods>
  88. <members>
  89. <member name="antialiased" type="bool" setter="set_antialiased" getter="get_antialiased" default="false">
  90. If [code]true[/code], polygon edges will be anti-aliased.
  91. </member>
  92. <member name="bones" type="Array" setter="_set_bones" getter="_get_bones" default="[ ]">
  93. </member>
  94. <member name="color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )">
  95. The polygon's fill color. If [code]texture[/code] is defined, it will be multiplied by this color. It will also be the default color for vertices not set in [code]vertex_colors[/code].
  96. </member>
  97. <member name="internal_vertex_count" type="int" setter="set_internal_vertex_count" getter="get_internal_vertex_count" default="0">
  98. </member>
  99. <member name="invert_border" type="float" setter="set_invert_border" getter="get_invert_border" default="100.0">
  100. Added padding applied to the bounding box when using [code]invert[/code]. Setting this value too small may result in a "Bad Polygon" error.
  101. </member>
  102. <member name="invert_enable" type="bool" setter="set_invert" getter="get_invert" default="false">
  103. If [code]true[/code], polygon will be inverted, containing the area outside the defined points and extending to the [code]invert_border[/code].
  104. </member>
  105. <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2( 0, 0 )">
  106. The offset applied to each vertex.
  107. </member>
  108. <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon" default="PoolVector2Array( )">
  109. The polygon's list of vertices. The final point will be connected to the first.
  110. [b]Note:[/b] This returns a copy of the [PoolVector2Array] rather than a reference.
  111. </member>
  112. <member name="polygons" type="Array" setter="set_polygons" getter="get_polygons" default="[ ]">
  113. </member>
  114. <member name="skeleton" type="NodePath" setter="set_skeleton" getter="get_skeleton" default="NodePath(&quot;&quot;)">
  115. </member>
  116. <member name="texture" type="Texture" setter="set_texture" getter="get_texture">
  117. The polygon's fill texture. Use [code]uv[/code] to set texture coordinates.
  118. </member>
  119. <member name="texture_offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" default="Vector2( 0, 0 )">
  120. Amount to offset the polygon's [code]texture[/code]. If [code](0, 0)[/code] the texture's origin (its top-left corner) will be placed at the polygon's [code]position[/code].
  121. </member>
  122. <member name="texture_rotation" type="float" setter="set_texture_rotation" getter="get_texture_rotation">
  123. The texture's rotation in radians.
  124. </member>
  125. <member name="texture_rotation_degrees" type="float" setter="set_texture_rotation_degrees" getter="get_texture_rotation_degrees" default="0.0">
  126. The texture's rotation in degrees.
  127. </member>
  128. <member name="texture_scale" type="Vector2" setter="set_texture_scale" getter="get_texture_scale" default="Vector2( 1, 1 )">
  129. Amount to multiply the [code]uv[/code] coordinates when using a [code]texture[/code]. Larger values make the texture smaller, and vice versa.
  130. </member>
  131. <member name="uv" type="PoolVector2Array" setter="set_uv" getter="get_uv" default="PoolVector2Array( )">
  132. Texture coordinates for each vertex of the polygon. There should be one [code]uv[/code] per polygon vertex. If there are fewer, undefined vertices will use [code](0, 0)[/code].
  133. </member>
  134. <member name="vertex_colors" type="PoolColorArray" setter="set_vertex_colors" getter="get_vertex_colors" default="PoolColorArray( )">
  135. Color for each vertex. Colors are interpolated between vertices, resulting in smooth gradients. There should be one per polygon vertex. If there are fewer, undefined vertices will use [code]color[/code].
  136. </member>
  137. </members>
  138. <constants>
  139. </constants>
  140. </class>