class_collisionshape2d.rst 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_CollisionShape2D:
  4. CollisionShape2D
  5. ================
  6. **Inherits:** :ref:`Node2D<class_node2d>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Editor-only class for easy editing of shapes.
  11. Member Functions
  12. ----------------
  13. +------------------------------+---------------------------------------------------------------------------------------------------------------------+
  14. | :ref:`int<class_int>` | :ref:`get_collision_object_shape_index<class_CollisionShape2D_get_collision_object_shape_index>` **(** **)** const |
  15. +------------------------------+---------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`Object<class_object>` | :ref:`get_shape<class_CollisionShape2D_get_shape>` **(** **)** const |
  17. +------------------------------+---------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`bool<class_bool>` | :ref:`is_trigger<class_CollisionShape2D_is_trigger>` **(** **)** const |
  19. +------------------------------+---------------------------------------------------------------------------------------------------------------------+
  20. | void | :ref:`set_shape<class_CollisionShape2D_set_shape>` **(** :ref:`Object<class_object>` shape **)** |
  21. +------------------------------+---------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`set_trigger<class_CollisionShape2D_set_trigger>` **(** :ref:`bool<class_bool>` enable **)** |
  23. +------------------------------+---------------------------------------------------------------------------------------------------------------------+
  24. Description
  25. -----------
  26. Editor-only class. This is not present when running the game. It's used in the editor to properly edit and position collision shapes in :ref:`CollisionObject2D<class_collisionobject2d>`. This is not accessible from regular code.
  27. Member Function Description
  28. ---------------------------
  29. .. _class_CollisionShape2D_get_collision_object_shape_index:
  30. - :ref:`int<class_int>` **get_collision_object_shape_index** **(** **)** const
  31. Return the index of this shape inside its container :ref:`CollisionObject2D<class_collisionobject2d>`. This can be used to directly access the underlying :ref:`Shape2D<class_shape2d>`.
  32. .. _class_CollisionShape2D_get_shape:
  33. - :ref:`Object<class_object>` **get_shape** **(** **)** const
  34. Return this shape's :ref:`Shape2D<class_shape2d>`.
  35. .. _class_CollisionShape2D_is_trigger:
  36. - :ref:`bool<class_bool>` **is_trigger** **(** **)** const
  37. Return whether this shape is a trigger.
  38. .. _class_CollisionShape2D_set_shape:
  39. - void **set_shape** **(** :ref:`Object<class_object>` shape **)**
  40. Set this shape's :ref:`Shape2D<class_shape2d>`. This will not appear as a node, but can be directly edited as a property.
  41. .. _class_CollisionShape2D_set_trigger:
  42. - void **set_trigger** **(** :ref:`bool<class_bool>` enable **)**
  43. Set whether this shape is a trigger. A trigger shape detects collisions, but is otherwise unaffected by physics (i.e. will not block movement of colliding objects).