Accepts unhandled InputEvents. Requires inputPickable to be true. shape_idx is the child index of the clicked Shape2D. Connect to the input_event signal to easily pick up these events.
Creates a new shape owner for the given object. Returns owner_id of the new owner for future reference.
Returns the object's RID.
Returns the one_way_collision_margin of the shape owner identified by given owner_id.
Returns an Array of owner_id identifiers. You can use these ids in other methods that take owner_id as an argument.
If true, the shape owner and its shapes are disabled.
Returns true if collisions for the shape owner originating from this CollisionObject2D will not be reported to collided with CollisionObject2Ds.
Removes the given shape owner.
Returns the owner_id of the given shape.
Adds a Shape2D to the shape owner.
Removes all shapes from the shape owner.
Returns the parent object of the given shape owner.
Returns the Shape2D with the given id from the given shape owner.
Returns the number of shapes the given shape owner contains.
Returns the child index of the Shape2D with the given id from the given shape owner.
Returns the shape owner's Transform2D.
Removes a shape from the given shape owner.
If true, disables the given shape owner.
If enable is true, collisions for the shape owner originating from this CollisionObject2D will not be reported to collided with CollisionObject2Ds.
Sets the one_way_collision_margin of the shape owner identified by given owner_id to margin pixels.
Sets the Transform2D of the given shape owner.
If true, this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events. Requires at least one collision_layer bit to be set.
Construct a new instance of CollisionObject2D. Note: use memnew!CollisionObject2D instead.
Base node for 2D collision objects.
CollisionObject2D is the base class for 2D physics objects. It can hold any number of 2D collision Shape2Ds. Each shape must be assigned to a shape owner. The CollisionObject2D can have any number of shape owners. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the shape_owner_* methods.