class_collisionshape2d.rst 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. Member Functions
  13. ----------------
  14. +--------------------------------+------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`Shape2D<class_shape2d>` | :ref:`get_shape<class_CollisionShape2D_get_shape>` **(** **)** const |
  16. +--------------------------------+------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`is_disabled<class_CollisionShape2D_is_disabled>` **(** **)** const |
  18. +--------------------------------+------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`bool<class_bool>` | :ref:`is_one_way_collision_enabled<class_CollisionShape2D_is_one_way_collision_enabled>` **(** **)** const |
  20. +--------------------------------+------------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`set_disabled<class_CollisionShape2D_set_disabled>` **(** :ref:`bool<class_bool>` disabled **)** |
  22. +--------------------------------+------------------------------------------------------------------------------------------------------------------------+
  23. | void | :ref:`set_one_way_collision<class_CollisionShape2D_set_one_way_collision>` **(** :ref:`bool<class_bool>` enabled **)** |
  24. +--------------------------------+------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`set_shape<class_CollisionShape2D_set_shape>` **(** :ref:`Shape2D<class_shape2d>` shape **)** |
  26. +--------------------------------+------------------------------------------------------------------------------------------------------------------------+
  27. Member Variables
  28. ----------------
  29. .. _class_CollisionShape2D_disabled:
  30. - :ref:`bool<class_bool>` **disabled** - A disabled collision shape has no effect in the world.
  31. .. _class_CollisionShape2D_one_way_collision:
  32. - :ref:`bool<class_bool>` **one_way_collision** - Sets whether this collision shape should only detect collision on one side (top or bottom).
  33. .. _class_CollisionShape2D_shape:
  34. - :ref:`Shape2D<class_shape2d>` **shape** - The actual shape owned by this collision shape.
  35. Description
  36. -----------
  37. 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 give create 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.
  38. Member Function Description
  39. ---------------------------
  40. .. _class_CollisionShape2D_get_shape:
  41. - :ref:`Shape2D<class_shape2d>` **get_shape** **(** **)** const
  42. .. _class_CollisionShape2D_is_disabled:
  43. - :ref:`bool<class_bool>` **is_disabled** **(** **)** const
  44. .. _class_CollisionShape2D_is_one_way_collision_enabled:
  45. - :ref:`bool<class_bool>` **is_one_way_collision_enabled** **(** **)** const
  46. .. _class_CollisionShape2D_set_disabled:
  47. - void **set_disabled** **(** :ref:`bool<class_bool>` disabled **)**
  48. .. _class_CollisionShape2D_set_one_way_collision:
  49. - void **set_one_way_collision** **(** :ref:`bool<class_bool>` enabled **)**
  50. .. _class_CollisionShape2D_set_shape:
  51. - void **set_shape** **(** :ref:`Shape2D<class_shape2d>` shape **)**