.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_CollisionShape2D: CollisionShape2D ================ **Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Editor-only class for easy editing of shapes. Member Functions ---------------- +------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_collision_object_shape_index` **(** **)** const | +------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_shape` **(** **)** const | +------------------------------+---------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_trigger` **(** **)** const | +------------------------------+---------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_shape` **(** :ref:`Object` shape **)** | +------------------------------+---------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_trigger` **(** :ref:`bool` enable **)** | +------------------------------+---------------------------------------------------------------------------------------------------------------------+ Description ----------- 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`. This is not accessible from regular code. Member Function Description --------------------------- .. _class_CollisionShape2D_get_collision_object_shape_index: - :ref:`int` **get_collision_object_shape_index** **(** **)** const Return the index of this shape inside its container :ref:`CollisionObject2D`. This can be used to directly access the underlying :ref:`Shape2D`. .. _class_CollisionShape2D_get_shape: - :ref:`Object` **get_shape** **(** **)** const Return this shape's :ref:`Shape2D`. .. _class_CollisionShape2D_is_trigger: - :ref:`bool` **is_trigger** **(** **)** const Return whether this shape is a trigger. .. _class_CollisionShape2D_set_shape: - void **set_shape** **(** :ref:`Object` shape **)** Set this shape's :ref:`Shape2D`. This will not appear as a node, but can be directly edited as a property. .. _class_CollisionShape2D_set_trigger: - void **set_trigger** **(** :ref:`bool` enable **)** 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).