class_collisionshape2d.rst 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the CollisionShape2D.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_CollisionShape2D:
  5. CollisionShape2D
  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. Node that represents collision shape data in 2D space.
  12. Properties
  13. ----------
  14. +-------------------------------+-------------------------------------------------------------------------------------------+
  15. | :ref:`bool<class_bool>` | :ref:`disabled<class_CollisionShape2D_property_disabled>` |
  16. +-------------------------------+-------------------------------------------------------------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`one_way_collision<class_CollisionShape2D_property_one_way_collision>` |
  18. +-------------------------------+-------------------------------------------------------------------------------------------+
  19. | :ref:`float<class_float>` | :ref:`one_way_collision_margin<class_CollisionShape2D_property_one_way_collision_margin>` |
  20. +-------------------------------+-------------------------------------------------------------------------------------------+
  21. | :ref:`Shape2D<class_Shape2D>` | :ref:`shape<class_CollisionShape2D_property_shape>` |
  22. +-------------------------------+-------------------------------------------------------------------------------------------+
  23. Description
  24. -----------
  25. Editor facility for creating and editing collision shapes in 2D space. You can use this node to represent all sorts of collision shapes, for example, add this to an :ref:`Area2D<class_Area2D>` to give it a detection shape, or add it to a :ref:`PhysicsBody2D<class_PhysicsBody2D>` to create a solid object. **IMPORTANT**: this is an Editor-only helper to create shapes, use :ref:`CollisionObject2D.shape_owner_get_shape<class_CollisionObject2D_method_shape_owner_get_shape>` to get the actual shape.
  26. Tutorials
  27. ---------
  28. - :doc:`../tutorials/physics/physics_introduction`
  29. Property Descriptions
  30. ---------------------
  31. .. _class_CollisionShape2D_property_disabled:
  32. - :ref:`bool<class_bool>` **disabled**
  33. +----------+---------------------+
  34. | *Setter* | set_disabled(value) |
  35. +----------+---------------------+
  36. | *Getter* | is_disabled() |
  37. +----------+---------------------+
  38. A disabled collision shape has no effect in the world.
  39. .. _class_CollisionShape2D_property_one_way_collision:
  40. - :ref:`bool<class_bool>` **one_way_collision**
  41. +----------+--------------------------------+
  42. | *Setter* | set_one_way_collision(value) |
  43. +----------+--------------------------------+
  44. | *Getter* | is_one_way_collision_enabled() |
  45. +----------+--------------------------------+
  46. Sets whether this collision shape should only detect collision on one side (top or bottom).
  47. .. _class_CollisionShape2D_property_one_way_collision_margin:
  48. - :ref:`float<class_float>` **one_way_collision_margin**
  49. +----------+-------------------------------------+
  50. | *Setter* | set_one_way_collision_margin(value) |
  51. +----------+-------------------------------------+
  52. | *Getter* | get_one_way_collision_margin() |
  53. +----------+-------------------------------------+
  54. .. _class_CollisionShape2D_property_shape:
  55. - :ref:`Shape2D<class_Shape2D>` **shape**
  56. +----------+------------------+
  57. | *Setter* | set_shape(value) |
  58. +----------+------------------+
  59. | *Getter* | get_shape() |
  60. +----------+------------------+
  61. The actual shape owned by this collision shape.