class_collisionshape2d.rst 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. - :ref:`bool<class_bool>` **disabled** - A disabled collision shape has no effect in the world.
  30. - :ref:`bool<class_bool>` **one_way_collision** - Sets whether this collision shape should only detect collision on one side (top or bottom).
  31. - :ref:`Shape2D<class_shape2d>` **shape** - The actual shape owned by this collision shape.
  32. Description
  33. -----------
  34. 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.
  35. Member Function Description
  36. ---------------------------
  37. .. _class_CollisionShape2D_get_shape:
  38. - :ref:`Shape2D<class_shape2d>` **get_shape** **(** **)** const
  39. .. _class_CollisionShape2D_is_disabled:
  40. - :ref:`bool<class_bool>` **is_disabled** **(** **)** const
  41. .. _class_CollisionShape2D_is_one_way_collision_enabled:
  42. - :ref:`bool<class_bool>` **is_one_way_collision_enabled** **(** **)** const
  43. .. _class_CollisionShape2D_set_disabled:
  44. - void **set_disabled** **(** :ref:`bool<class_bool>` disabled **)**
  45. .. _class_CollisionShape2D_set_one_way_collision:
  46. - void **set_one_way_collision** **(** :ref:`bool<class_bool>` enabled **)**
  47. .. _class_CollisionShape2D_set_shape:
  48. - void **set_shape** **(** :ref:`Shape2D<class_shape2d>` shape **)**