Polygon2D.xml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Polygon2D" inherits="Node2D" version="4.0">
  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. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="add_bone">
  13. <return type="void" />
  14. <argument index="0" name="path" type="NodePath" />
  15. <argument index="1" name="weights" type="PackedFloat32Array" />
  16. <description>
  17. Adds a bone with the specified [code]path[/code] and [code]weights[/code].
  18. </description>
  19. </method>
  20. <method name="clear_bones">
  21. <return type="void" />
  22. <description>
  23. Removes all bones from this [Polygon2D].
  24. </description>
  25. </method>
  26. <method name="erase_bone">
  27. <return type="void" />
  28. <argument index="0" name="index" type="int" />
  29. <description>
  30. Removes the specified bone from this [Polygon2D].
  31. </description>
  32. </method>
  33. <method name="get_bone_count" qualifiers="const">
  34. <return type="int" />
  35. <description>
  36. Returns the number of bones in this [Polygon2D].
  37. </description>
  38. </method>
  39. <method name="get_bone_path" qualifiers="const">
  40. <return type="NodePath" />
  41. <argument index="0" name="index" type="int" />
  42. <description>
  43. Returns the path to the node associated with the specified bone.
  44. </description>
  45. </method>
  46. <method name="get_bone_weights" qualifiers="const">
  47. <return type="PackedFloat32Array" />
  48. <argument index="0" name="index" type="int" />
  49. <description>
  50. Returns the height values of the specified bone.
  51. </description>
  52. </method>
  53. <method name="set_bone_path">
  54. <return type="void" />
  55. <argument index="0" name="index" type="int" />
  56. <argument index="1" name="path" type="NodePath" />
  57. <description>
  58. Sets the path to the node associated with the specified bone.
  59. </description>
  60. </method>
  61. <method name="set_bone_weights">
  62. <return type="void" />
  63. <argument index="0" name="index" type="int" />
  64. <argument index="1" name="weights" type="PackedFloat32Array" />
  65. <description>
  66. Sets the weight values for the specified bone.
  67. </description>
  68. </method>
  69. </methods>
  70. <members>
  71. <member name="antialiased" type="bool" setter="set_antialiased" getter="get_antialiased" default="false">
  72. If [code]true[/code], polygon edges will be anti-aliased.
  73. </member>
  74. <member name="bones" type="Array" setter="_set_bones" getter="_get_bones" default="[]">
  75. </member>
  76. <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)">
  77. 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].
  78. </member>
  79. <member name="internal_vertex_count" type="int" setter="set_internal_vertex_count" getter="get_internal_vertex_count" default="0">
  80. </member>
  81. <member name="invert_border" type="float" setter="set_invert_border" getter="get_invert_border" default="100.0">
  82. Added padding applied to the bounding box when using [code]invert[/code]. Setting this value too small may result in a "Bad Polygon" error.
  83. </member>
  84. <member name="invert_enable" type="bool" setter="set_invert" getter="get_invert" default="false">
  85. If [code]true[/code], polygon will be inverted, containing the area outside the defined points and extending to the [code]invert_border[/code].
  86. </member>
  87. <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)">
  88. The offset applied to each vertex.
  89. </member>
  90. <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array()">
  91. The polygon's list of vertices. The final point will be connected to the first.
  92. [b]Note:[/b] This returns a copy of the [PackedVector2Array] rather than a reference.
  93. </member>
  94. <member name="polygons" type="Array" setter="set_polygons" getter="get_polygons" default="[]">
  95. </member>
  96. <member name="skeleton" type="NodePath" setter="set_skeleton" getter="get_skeleton" default="NodePath(&quot;&quot;)">
  97. </member>
  98. <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture">
  99. The polygon's fill texture. Use [code]uv[/code] to set texture coordinates.
  100. </member>
  101. <member name="texture_offset" type="Vector2" setter="set_texture_offset" getter="get_texture_offset" default="Vector2(0, 0)">
  102. 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].
  103. </member>
  104. <member name="texture_rotation" type="float" setter="set_texture_rotation" getter="get_texture_rotation" default="0.0">
  105. The texture's rotation in radians.
  106. </member>
  107. <member name="texture_scale" type="Vector2" setter="set_texture_scale" getter="get_texture_scale" default="Vector2(1, 1)">
  108. Amount to multiply the [code]uv[/code] coordinates when using a [code]texture[/code]. Larger values make the texture smaller, and vice versa.
  109. </member>
  110. <member name="uv" type="PackedVector2Array" setter="set_uv" getter="get_uv" default="PackedVector2Array()">
  111. 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].
  112. </member>
  113. <member name="vertex_colors" type="PackedColorArray" setter="set_vertex_colors" getter="get_vertex_colors" default="PackedColorArray()">
  114. 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].
  115. </member>
  116. </members>
  117. </class>