CollisionPolygon2D.xml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="CollisionPolygon2D" inherits="Node2D" version="3.3">
  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. <methods>
  12. </methods>
  13. <members>
  14. <member name="build_mode" type="int" setter="set_build_mode" getter="get_build_mode" enum="CollisionPolygon2D.BuildMode" default="0">
  15. Collision build mode. Use one of the [enum BuildMode] constants.
  16. </member>
  17. <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" default="false">
  18. If [code]true[/code], no collisions will be detected.
  19. </member>
  20. <member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled" default="false">
  21. If [code]true[/code], only edges that face up, relative to [CollisionPolygon2D]'s rotation, will collide with other objects.
  22. </member>
  23. <member name="one_way_collision_margin" type="float" setter="set_one_way_collision_margin" getter="get_one_way_collision_margin" default="1.0">
  24. 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.
  25. </member>
  26. <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon" default="PoolVector2Array( )">
  27. The polygon's list of vertices. The final point will be connected to the first. The returned value is a clone of the [PoolVector2Array], not a reference.
  28. </member>
  29. </members>
  30. <constants>
  31. <constant name="BUILD_SOLIDS" value="0" enum="BuildMode">
  32. Collisions will include the polygon and its contained area.
  33. </constant>
  34. <constant name="BUILD_SEGMENTS" value="1" enum="BuildMode">
  35. Collisions will only include the polygon edges.
  36. </constant>
  37. </constants>
  38. </class>