2D area that detects [CollisionObject2D] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping).
Return whether gravity is a point. A point gravity will attract objects towards it, as opposed to a gravity vector, which moves them in a given direction.
</description>
</method>
<methodname="is_monitorable"qualifiers="const">
<returntype="bool">
</return>
<description>
Return whether this area can be detected by other, monitoring, areas.
</description>
</method>
<methodname="is_monitoring"qualifiers="const">
<returntype="bool">
</return>
<description>
Return whether this area detects bodies/areas entering/exiting it.
Set the rate at which objects stop spinning in this area, if there are not any other forces making it spin. The value is a fraction of its current speed, lost per second. Thus, a value of 1.0 should mean stopping immediately, and 0.0 means the object never stops.
In practice, as the fraction of speed lost gets smaller with each frame, a value of 1.0 does not mean the object will stop in exactly one second. Only when the physics calculations are done at 1 frame per second, it does stop in a second.
Collidable objects can exist in any of 32 different layers. These layers are not visual, but more of a tagging system instead. A collidable can use these layers/tags to select with which objects it can collide, using [method set_collision_mask].
A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A.
</description>
</method>
<methodname="set_collision_layer_bit">
<returntype="void">
</return>
<argumentindex="0"name="bit"type="int">
</argument>
<argumentindex="1"name="value"type="bool">
</argument>
<description>
Set/clear individual bits on the layer mask. This makes getting an area in/out of only one layer easier.
Set the physics layers this area can scan for collisions.
</description>
</method>
<methodname="set_collision_mask_bit">
<returntype="void">
</return>
<argumentindex="0"name="bit"type="int">
</argument>
<argumentindex="1"name="value"type="bool">
</argument>
<description>
Set/clear individual bits on the collision mask. This makes selecting the areas scanned easier.
</description>
</method>
<methodname="set_gravity">
<returntype="void">
</return>
<argumentindex="0"name="gravity"type="float">
</argument>
<description>
Set the gravity intensity. This is useful to alter the force of gravity without altering its direction.
This value multiplies the gravity vector, whether it is the given vector ([method set_gravity_vector]), or a calculated one (when using a center of gravity).
Set the falloff factor for point gravity. The greater this value is, the faster the strength of gravity decreases with the square of distance.
</description>
</method>
<methodname="set_gravity_is_point">
<returntype="void">
</return>
<argumentindex="0"name="enable"type="bool">
</argument>
<description>
When overriding space parameters, this method sets whether this area has a center of gravity. To set/get the location of the center of gravity, use [method set_gravity_vector]/[method get_gravity_vector].
</description>
</method>
<methodname="set_gravity_vector">
<returntype="void">
</return>
<argumentindex="0"name="vector"type="Vector2">
</argument>
<description>
Set the gravity vector. This vector does not have to be normalized.
If gravity is a point (see [method is_gravity_a_point]), this will be the attraction center.
</description>
</method>
<methodname="set_linear_damp">
<returntype="void">
</return>
<argumentindex="0"name="linear_damp"type="float">
</argument>
<description>
Set the rate at which objects stop moving in this area, if there are not any other forces moving it. The value is a fraction of its current speed, lost per second. Thus, a value of 1.0 should mean stopping immediately, and 0.0 means the object never stops.
In practice, as the fraction of speed lost gets smaller with each frame, a value of 1.0 does not mean the object will stop in exactly one second. Only when the physics calculations are done at 1 frame per second, it does stop in a second.
</description>
</method>
<methodname="set_monitorable">
<returntype="void">
</return>
<argumentindex="0"name="enable"type="bool">
</argument>
<description>
Set whether this area can be detected by other, monitoring, areas. Only areas need to be marked as monitorable. Bodies are always so.
</description>
</method>
<methodname="set_monitoring">
<returntype="void">
</return>
<argumentindex="0"name="enable"type="bool">
</argument>
<description>
Set whether this area can detect bodies/areas entering/exiting it.
</description>
</method>
<methodname="set_priority">
<returntype="void">
</return>
<argumentindex="0"name="priority"type="float">
</argument>
<description>
Set the order in which the area is processed. Greater values mean the area gets processed first. This is useful for areas which have a space override different from AREA_SPACE_OVERRIDE_DISABLED or AREA_SPACE_OVERRIDE_COMBINE, as they replace values, and are thus order-dependent.
Areas with the same priority value get evaluated in an unpredictable order, and should be differentiated if evaluation order is to be important.
Set the space override mode. This mode controls how an area affects gravity and damp.
AREA_SPACE_OVERRIDE_DISABLED: This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them.
AREA_SPACE_OVERRIDE_COMBINE: This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects.
AREA_SPACE_OVERRIDE_COMBINE_REPLACE: This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one.
AREA_SPACE_OVERRIDE_REPLACE: This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas.
AREA_SPACE_OVERRIDE_REPLACE_COMBINE: This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one.
The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [code]collision_mask[/code].
The area's gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction.
If [code]true[/code] gravity is calculated from a point (set via [code]gravity_vec[/code]). Also see [code]space_override[/code]. Default value: [code]false[/code].
The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).