class_collisionpolygon2d.rst 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the CollisionPolygon2D.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_CollisionPolygon2D:
  6. CollisionPolygon2D
  7. ==================
  8. **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Defines a 2D collision polygon.
  13. Properties
  14. ----------
  15. +-----------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------+
  16. | :ref:`BuildMode<enum_CollisionPolygon2D_BuildMode>` | :ref:`build_mode<class_CollisionPolygon2D_property_build_mode>` | 0 |
  17. +-----------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------+
  18. | :ref:`bool<class_bool>` | :ref:`disabled<class_CollisionPolygon2D_property_disabled>` | false |
  19. +-----------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------+
  20. | :ref:`bool<class_bool>` | :ref:`one_way_collision<class_CollisionPolygon2D_property_one_way_collision>` | false |
  21. +-----------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------+
  22. | :ref:`float<class_float>` | :ref:`one_way_collision_margin<class_CollisionPolygon2D_property_one_way_collision_margin>` | 1.0 |
  23. +-----------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------+
  24. | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`polygon<class_CollisionPolygon2D_property_polygon>` | PoolVector2Array( ) |
  25. +-----------------------------------------------------+---------------------------------------------------------------------------------------------+----------------------+
  26. Enumerations
  27. ------------
  28. .. _enum_CollisionPolygon2D_BuildMode:
  29. .. _class_CollisionPolygon2D_constant_BUILD_SOLIDS:
  30. .. _class_CollisionPolygon2D_constant_BUILD_SEGMENTS:
  31. enum **BuildMode**:
  32. - **BUILD_SOLIDS** = **0** --- Collisions will include the polygon and its contained area.
  33. - **BUILD_SEGMENTS** = **1** --- Collisions will only include the polygon edges.
  34. Description
  35. -----------
  36. 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.
  37. Property Descriptions
  38. ---------------------
  39. .. _class_CollisionPolygon2D_property_build_mode:
  40. - :ref:`BuildMode<enum_CollisionPolygon2D_BuildMode>` **build_mode**
  41. +-----------+-----------------------+
  42. | *Default* | 0 |
  43. +-----------+-----------------------+
  44. | *Setter* | set_build_mode(value) |
  45. +-----------+-----------------------+
  46. | *Getter* | get_build_mode() |
  47. +-----------+-----------------------+
  48. Collision build mode. Use one of the ``BUILD_*`` constants.
  49. .. _class_CollisionPolygon2D_property_disabled:
  50. - :ref:`bool<class_bool>` **disabled**
  51. +-----------+---------------------+
  52. | *Default* | false |
  53. +-----------+---------------------+
  54. | *Setter* | set_disabled(value) |
  55. +-----------+---------------------+
  56. | *Getter* | is_disabled() |
  57. +-----------+---------------------+
  58. If ``true``, no collisions will be detected.
  59. .. _class_CollisionPolygon2D_property_one_way_collision:
  60. - :ref:`bool<class_bool>` **one_way_collision**
  61. +-----------+--------------------------------+
  62. | *Default* | false |
  63. +-----------+--------------------------------+
  64. | *Setter* | set_one_way_collision(value) |
  65. +-----------+--------------------------------+
  66. | *Getter* | is_one_way_collision_enabled() |
  67. +-----------+--------------------------------+
  68. If ``true``, only edges that face up, relative to CollisionPolygon2D's rotation, will collide with other objects.
  69. .. _class_CollisionPolygon2D_property_one_way_collision_margin:
  70. - :ref:`float<class_float>` **one_way_collision_margin**
  71. +-----------+-------------------------------------+
  72. | *Default* | 1.0 |
  73. +-----------+-------------------------------------+
  74. | *Setter* | set_one_way_collision_margin(value) |
  75. +-----------+-------------------------------------+
  76. | *Getter* | get_one_way_collision_margin() |
  77. +-----------+-------------------------------------+
  78. .. _class_CollisionPolygon2D_property_polygon:
  79. - :ref:`PoolVector2Array<class_PoolVector2Array>` **polygon**
  80. +-----------+----------------------+
  81. | *Default* | PoolVector2Array( ) |
  82. +-----------+----------------------+
  83. | *Setter* | set_polygon(value) |
  84. +-----------+----------------------+
  85. | *Getter* | get_polygon() |
  86. +-----------+----------------------+
  87. 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.