class_collisionpolygon2d.rst 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. Properties
  13. ----------
  14. +-----------------------------------------------------+-------------------------------------------------------------------------------+
  15. | :ref:`BuildMode<enum_CollisionPolygon2D_BuildMode>` | :ref:`build_mode<class_CollisionPolygon2D_property_build_mode>` |
  16. +-----------------------------------------------------+-------------------------------------------------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`disabled<class_CollisionPolygon2D_property_disabled>` |
  18. +-----------------------------------------------------+-------------------------------------------------------------------------------+
  19. | :ref:`bool<class_bool>` | :ref:`one_way_collision<class_CollisionPolygon2D_property_one_way_collision>` |
  20. +-----------------------------------------------------+-------------------------------------------------------------------------------+
  21. | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`polygon<class_CollisionPolygon2D_property_polygon>` |
  22. +-----------------------------------------------------+-------------------------------------------------------------------------------+
  23. Enumerations
  24. ------------
  25. .. _enum_CollisionPolygon2D_BuildMode:
  26. .. _class_CollisionPolygon2D_constant_BUILD_SOLIDS:
  27. .. _class_CollisionPolygon2D_constant_BUILD_SEGMENTS:
  28. enum **BuildMode**:
  29. - **BUILD_SOLIDS** = **0** --- Collisions will include the polygon and its contained area.
  30. - **BUILD_SEGMENTS** = **1** --- Collisions will only include the polygon edges.
  31. Description
  32. -----------
  33. 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.
  34. Property Descriptions
  35. ---------------------
  36. .. _class_CollisionPolygon2D_property_build_mode:
  37. - :ref:`BuildMode<enum_CollisionPolygon2D_BuildMode>` **build_mode**
  38. +----------+-----------------------+
  39. | *Setter* | set_build_mode(value) |
  40. +----------+-----------------------+
  41. | *Getter* | get_build_mode() |
  42. +----------+-----------------------+
  43. Collision build mode. Use one of the ``BUILD_*`` constants. Default value: ``BUILD_SOLIDS``.
  44. .. _class_CollisionPolygon2D_property_disabled:
  45. - :ref:`bool<class_bool>` **disabled**
  46. +----------+---------------------+
  47. | *Setter* | set_disabled(value) |
  48. +----------+---------------------+
  49. | *Getter* | is_disabled() |
  50. +----------+---------------------+
  51. If ``true``, no collisions will be detected.
  52. .. _class_CollisionPolygon2D_property_one_way_collision:
  53. - :ref:`bool<class_bool>` **one_way_collision**
  54. +----------+--------------------------------+
  55. | *Setter* | set_one_way_collision(value) |
  56. +----------+--------------------------------+
  57. | *Getter* | is_one_way_collision_enabled() |
  58. +----------+--------------------------------+
  59. If ``true``, only edges that face up, relative to CollisionPolygon2D's rotation, will collide with other objects.
  60. .. _class_CollisionPolygon2D_property_polygon:
  61. - :ref:`PoolVector2Array<class_PoolVector2Array>` **polygon**
  62. +----------+--------------------+
  63. | *Setter* | set_polygon(value) |
  64. +----------+--------------------+
  65. | *Getter* | get_polygon() |
  66. +----------+--------------------+
  67. The polygon's list of vertices. The final point will be connected to the first.