CollisionPolygon2D.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="CollisionPolygon2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. Defines a 2D collision polygon.
  5. </brief_description>
  6. <description>
  7. Provides a 2D collision polygon to a [CollisionObject2D] parent. Polygon can be drawn in the editor or specified by a list of vertices.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="get_build_mode" qualifiers="const">
  15. <return type="int" enum="CollisionPolygon2D.BuildMode">
  16. </return>
  17. <description>
  18. Return whether the polygon is a [ConvexPolygonShape2D] ([code]build_mode==0[/code]), or a [ConcavePolygonShape2D] ([code]build_mode==1[/code]).
  19. </description>
  20. </method>
  21. <method name="get_polygon" qualifiers="const">
  22. <return type="PoolVector2Array">
  23. </return>
  24. <description>
  25. Return the list of points that define the polygon.
  26. </description>
  27. </method>
  28. <method name="is_disabled" qualifiers="const">
  29. <return type="bool">
  30. </return>
  31. <description>
  32. </description>
  33. </method>
  34. <method name="is_one_way_collision_enabled" qualifiers="const">
  35. <return type="bool">
  36. </return>
  37. <description>
  38. </description>
  39. </method>
  40. <method name="set_build_mode">
  41. <return type="void">
  42. </return>
  43. <argument index="0" name="build_mode" type="int" enum="CollisionPolygon2D.BuildMode">
  44. </argument>
  45. <description>
  46. Set whether the polygon is to be a [ConvexPolygonShape2D] ([code]build_mode==0[/code]), or a [ConcavePolygonShape2D] ([code]build_mode==1[/code]).
  47. </description>
  48. </method>
  49. <method name="set_disabled">
  50. <return type="void">
  51. </return>
  52. <argument index="0" name="disabled" type="bool">
  53. </argument>
  54. <description>
  55. </description>
  56. </method>
  57. <method name="set_one_way_collision">
  58. <return type="void">
  59. </return>
  60. <argument index="0" name="enabled" type="bool">
  61. </argument>
  62. <description>
  63. </description>
  64. </method>
  65. <method name="set_polygon">
  66. <return type="void">
  67. </return>
  68. <argument index="0" name="polygon" type="PoolVector2Array">
  69. </argument>
  70. <description>
  71. Set the array of points forming the polygon.
  72. When editing the point list via the editor, depending on [method get_build_mode], it has to be a list of points (for [code]build_mode==0[/code]), or a list of lines (for [code]build_mode==1[/code]). In the second case, the even elements of the array define the start point of the line, and the odd elements the end point.
  73. </description>
  74. </method>
  75. </methods>
  76. <members>
  77. <member name="build_mode" type="int" setter="set_build_mode" getter="get_build_mode" enum="CollisionPolygon2D.BuildMode">
  78. Collision build mode. Use one of the [code]BUILD_*[/code] constants. Default value: [code]BUILD_SOLIDS[/code].
  79. </member>
  80. <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled">
  81. If [code]true[/code] no collisions will be detected.
  82. </member>
  83. <member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled">
  84. If [code]true[/code] only edges that face up, relative to CollisionPolygon2D's rotation, will collide with other objects.
  85. </member>
  86. <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon">
  87. The polygon's list of vertices. The final point will be connected to the first.
  88. </member>
  89. </members>
  90. <constants>
  91. <constant name="BUILD_SOLIDS" value="0">
  92. Collisions will include the polygon and its contained area.
  93. </constant>
  94. <constant name="BUILD_SEGMENTS" value="1">
  95. Collisions will only include the polygon edges.
  96. </constant>
  97. </constants>
  98. </class>