class_collisionpolygon2d.rst 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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:`float<class_float>` | :ref:`one_way_collision_margin<class_CollisionPolygon2D_property_one_way_collision_margin>` |
  22. +-----------------------------------------------------+---------------------------------------------------------------------------------------------+
  23. | :ref:`PoolVector2Array<class_PoolVector2Array>` | :ref:`polygon<class_CollisionPolygon2D_property_polygon>` |
  24. +-----------------------------------------------------+---------------------------------------------------------------------------------------------+
  25. Enumerations
  26. ------------
  27. .. _enum_CollisionPolygon2D_BuildMode:
  28. .. _class_CollisionPolygon2D_constant_BUILD_SOLIDS:
  29. .. _class_CollisionPolygon2D_constant_BUILD_SEGMENTS:
  30. enum **BuildMode**:
  31. - **BUILD_SOLIDS** = **0** --- Collisions will include the polygon and its contained area.
  32. - **BUILD_SEGMENTS** = **1** --- Collisions will only include the polygon edges.
  33. Description
  34. -----------
  35. 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.
  36. Property Descriptions
  37. ---------------------
  38. .. _class_CollisionPolygon2D_property_build_mode:
  39. - :ref:`BuildMode<enum_CollisionPolygon2D_BuildMode>` **build_mode**
  40. +----------+-----------------------+
  41. | *Setter* | set_build_mode(value) |
  42. +----------+-----------------------+
  43. | *Getter* | get_build_mode() |
  44. +----------+-----------------------+
  45. Collision build mode. Use one of the ``BUILD_*`` constants. Default value: ``BUILD_SOLIDS``.
  46. .. _class_CollisionPolygon2D_property_disabled:
  47. - :ref:`bool<class_bool>` **disabled**
  48. +----------+---------------------+
  49. | *Setter* | set_disabled(value) |
  50. +----------+---------------------+
  51. | *Getter* | is_disabled() |
  52. +----------+---------------------+
  53. If ``true``, no collisions will be detected.
  54. .. _class_CollisionPolygon2D_property_one_way_collision:
  55. - :ref:`bool<class_bool>` **one_way_collision**
  56. +----------+--------------------------------+
  57. | *Setter* | set_one_way_collision(value) |
  58. +----------+--------------------------------+
  59. | *Getter* | is_one_way_collision_enabled() |
  60. +----------+--------------------------------+
  61. If ``true``, only edges that face up, relative to CollisionPolygon2D's rotation, will collide with other objects.
  62. .. _class_CollisionPolygon2D_property_one_way_collision_margin:
  63. - :ref:`float<class_float>` **one_way_collision_margin**
  64. +----------+-------------------------------------+
  65. | *Setter* | set_one_way_collision_margin(value) |
  66. +----------+-------------------------------------+
  67. | *Getter* | get_one_way_collision_margin() |
  68. +----------+-------------------------------------+
  69. .. _class_CollisionPolygon2D_property_polygon:
  70. - :ref:`PoolVector2Array<class_PoolVector2Array>` **polygon**
  71. +----------+--------------------+
  72. | *Setter* | set_polygon(value) |
  73. +----------+--------------------+
  74. | *Getter* | get_polygon() |
  75. +----------+--------------------+
  76. 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.