class_collisionpolygon2d.rst 3.6 KB

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