- _inputEvent
void _inputEvent(GodotObject viewport, InputEvent event, long shape_idx)
Accepts unhandled InputEvents. shape_idx is the child index of the clicked Shape2D. Connect to the input_event signal to easily pick up these events.
- createShapeOwner
long createShapeOwner(GodotObject owner)
Creates a new shape owner for the given object. Returns owner_id of the new owner for future reference.
- getRid
RID getRid()
Returns the object's RID.
- getShapeOwners
Array getShapeOwners()
Returns an Array of owner_id identifiers. You can use these ids in other methods that take owner_id as an argument.
- isPickable
bool isPickable()
- isShapeOwnerDisabled
bool isShapeOwnerDisabled(long owner_id)
If true the shape owner and its shapes are disabled.
- isShapeOwnerOneWayCollisionEnabled
bool isShapeOwnerOneWayCollisionEnabled(long owner_id)
Returns true if collisions for the shape owner originating from this CollisionObject2D will not be reported to collided with CollisionObject2Ds.
- opAssign
CollisionObject2D opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
- opEquals
bool opEquals(CollisionObject2D other)
Undocumented in source. Be warned that the author may not have intended to support it.
- opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
- removeShapeOwner
void removeShapeOwner(long owner_id)
Removes the given shape owner.
- setPickable
void setPickable(bool enabled)
- shapeFindOwner
long shapeFindOwner(long shape_index)
Returns the owner_id of the given shape.
- shapeOwnerAddShape
void shapeOwnerAddShape(long owner_id, Shape2D shape)
- shapeOwnerClearShapes
void shapeOwnerClearShapes(long owner_id)
Removes all shapes from the shape owner.
- shapeOwnerGetOwner
GodotObject shapeOwnerGetOwner(long owner_id)
Returns the parent object of the given shape owner.
- shapeOwnerGetShape
Ref!Shape2D shapeOwnerGetShape(long owner_id, long shape_id)
Returns the Shape2D with the given id from the given shape owner.
- shapeOwnerGetShapeCount
long shapeOwnerGetShapeCount(long owner_id)
Returns the number of shapes the given shape owner contains.
- shapeOwnerGetShapeIndex
long shapeOwnerGetShapeIndex(long owner_id, long shape_id)
Returns the child index of the Shape2D with the given id from the given shape owner.
- shapeOwnerGetTransform
Transform2D shapeOwnerGetTransform(long owner_id)
Returns the shape owner's Transform2D.
- shapeOwnerRemoveShape
void shapeOwnerRemoveShape(long owner_id, long shape_id)
Removes a shape from the given shape owner.
- shapeOwnerSetDisabled
void shapeOwnerSetDisabled(long owner_id, bool disabled)
If true disables the given shape owner.
- shapeOwnerSetOneWayCollision
void shapeOwnerSetOneWayCollision(long owner_id, bool enable)
If enable is true, collisions for the shape owner originating from this CollisionObject2D will not be reported to collided with CollisionObject2Ds.
- shapeOwnerSetTransform
void shapeOwnerSetTransform(long owner_id, Transform2D transform)
Sets the Transform2D of the given shape owner.
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.