2
0

CollisionPolygon2D.xml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="CollisionPolygon2D" inherits="Node2D" version="4.0">
  3. <brief_description>
  4. Defines a 2D collision polygon.
  5. </brief_description>
  6. <description>
  7. Provides a 2D collision polygon to a [CollisionObject2D] parent. Polygons can be drawn in the editor or specified by a list of vertices.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <members>
  12. <member name="build_mode" type="int" setter="set_build_mode" getter="get_build_mode" enum="CollisionPolygon2D.BuildMode" default="0">
  13. Collision build mode. Use one of the [enum BuildMode] constants.
  14. </member>
  15. <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" default="false">
  16. If [code]true[/code], no collisions will be detected.
  17. </member>
  18. <member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled" default="false">
  19. If [code]true[/code], only edges that face up, relative to [CollisionPolygon2D]'s rotation, will collide with other objects.
  20. </member>
  21. <member name="one_way_collision_margin" type="float" setter="set_one_way_collision_margin" getter="get_one_way_collision_margin" default="1.0">
  22. The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the polygon at a high velocity.
  23. </member>
  24. <member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array()">
  25. The polygon's list of vertices. The final point will be connected to the first. The returned value is a clone of the [PackedVector2Array], not a reference.
  26. </member>
  27. </members>
  28. <constants>
  29. <constant name="BUILD_SOLIDS" value="0" enum="BuildMode">
  30. Collisions will include the polygon and its contained area.
  31. </constant>
  32. <constant name="BUILD_SEGMENTS" value="1" enum="BuildMode">
  33. Collisions will only include the polygon edges.
  34. </constant>
  35. </constants>
  36. </class>