Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
Area2D¶
Inherits: CollisionObject2D < Node2D < CanvasItem < Node < Object
A region of 2D space that detects other CollisionObject2Ds entering or exiting it.
Description¶
Area2D is a region of 2D space defined by one or multiple CollisionShape2D or CollisionPolygon2D child nodes. It detects when other CollisionObject2Ds enter or exit it, and it also keeps track of which collision objects haven't exited it yet (i.e. which one are overlapping it).
This node can also locally alter or override physics parameters (gravity, damping) and route audio to custom audio buses.
Tutorials¶
Properties¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods¶
get_overlapping_areas ( ) const |
|
get_overlapping_bodies ( ) const |
|
has_overlapping_areas ( ) const |
|
has_overlapping_bodies ( ) const |
|
overlaps_area ( Node area ) const |
|
overlaps_body ( Node body ) const |
Signals¶
area_entered ( Area2D area )
Emitted when the received area
enters this area. Requires monitoring to be set to true
.
area_exited ( Area2D area )
Emitted when the received area
exits this area. Requires monitoring to be set to true
.
area_shape_entered ( RID area_rid, Area2D area, int area_shape_index, int local_shape_index )
Emitted when a Shape2D of the received area
enters a shape of this area. Requires monitoring to be set to true
.
local_shape_index
and area_shape_index
contain indices of the interacting shapes from this area and the other area, respectively. area_rid