class_collisionpolygon2d.rst 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the CollisionPolygon2D.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_CollisionPolygon2D:
  5. CollisionPolygon2D
  6. ==================
  7. **Inherits:** :ref:`Node2D<class_node2d>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Defines a 2D collision polygon.
  12. Member Variables
  13. ----------------
  14. .. _class_CollisionPolygon2D_build_mode:
  15. - :ref:`BuildMode<enum_collisionpolygon2d_buildmode>` **build_mode** - Collision build mode. Use one of the ``BUILD_*`` constants. Default value: ``BUILD_SOLIDS``.
  16. .. _class_CollisionPolygon2D_disabled:
  17. - :ref:`bool<class_bool>` **disabled** - If ``true`` no collisions will be detected.
  18. .. _class_CollisionPolygon2D_one_way_collision:
  19. - :ref:`bool<class_bool>` **one_way_collision** - If ``true`` only edges that face up, relative to CollisionPolygon2D's rotation, will collide with other objects.
  20. .. _class_CollisionPolygon2D_polygon:
  21. - :ref:`PoolVector2Array<class_poolvector2array>` **polygon** - The polygon's list of vertices. The final point will be connected to the first.
  22. Enums
  23. -----
  24. .. _enum_CollisionPolygon2D_BuildMode:
  25. enum **BuildMode**
  26. - **BUILD_SOLIDS** = **0** --- Collisions will include the polygon and its contained area.
  27. - **BUILD_SEGMENTS** = **1** --- Collisions will only include the polygon edges.
  28. Description
  29. -----------
  30. Provides a 2D collision polygon to a :ref:`CollisionObject2D<class_collisionobject2d>` parent. Polygon can be drawn in the editor or specified by a list of vertices.