class_collisionshape2d.rst 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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_disabled>` |
  16. +-------------------------------+--------------------------------------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`one_way_collision<class_CollisionShape2D_one_way_collision>` |
  18. +-------------------------------+--------------------------------------------------------------------+
  19. | :ref:`Shape2D<class_Shape2D>` | :ref:`shape<class_CollisionShape2D_shape>` |
  20. +-------------------------------+--------------------------------------------------------------------+
  21. Description
  22. -----------
  23. 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:`get_shape<class_CollisionShape2D_get_shape>` to get the actual shape.
  24. Tutorials
  25. ---------
  26. - :doc:`../tutorials/physics/physics_introduction`
  27. Property Descriptions
  28. ---------------------
  29. .. _class_CollisionShape2D_disabled:
  30. - :ref:`bool<class_bool>` **disabled**
  31. +----------+---------------------+
  32. | *Setter* | set_disabled(value) |
  33. +----------+---------------------+
  34. | *Getter* | is_disabled() |
  35. +----------+---------------------+
  36. A disabled collision shape has no effect in the world.
  37. .. _class_CollisionShape2D_one_way_collision:
  38. - :ref:`bool<class_bool>` **one_way_collision**
  39. +----------+--------------------------------+
  40. | *Setter* | set_one_way_collision(value) |
  41. +----------+--------------------------------+
  42. | *Getter* | is_one_way_collision_enabled() |
  43. +----------+--------------------------------+
  44. Sets whether this collision shape should only detect collision on one side (top or bottom).
  45. .. _class_CollisionShape2D_shape:
  46. - :ref:`Shape2D<class_Shape2D>` **shape**
  47. +----------+------------------+
  48. | *Setter* | set_shape(value) |
  49. +----------+------------------+
  50. | *Getter* | get_shape() |
  51. +----------+------------------+
  52. The actual shape owned by this collision shape.