diff options
Diffstat (limited to 'doc/classes/Area2D.xml')
-rw-r--r-- | doc/classes/Area2D.xml | 73 |
1 files changed, 42 insertions, 31 deletions
diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index 25f67f0571..8abdaac45f 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -16,13 +16,15 @@ <method name="get_overlapping_areas" qualifiers="const"> <return type="Area2D[]" /> <description> - Returns a list of intersecting [Area2D]s. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. + Returns a list of intersecting [Area2D]s. The overlapping area's [member CollisionObject2D.collision_layer] must be part of this area's [member CollisionObject2D.collision_mask] in order to be detected. + For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. </description> </method> <method name="get_overlapping_bodies" qualifiers="const"> <return type="Node2D[]" /> <description> - Returns a list of intersecting [PhysicsBody2D]s. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. + Returns a list of intersecting [PhysicsBody2D]s. The overlapping body's [member CollisionObject2D.collision_layer] must be part of this area's [member CollisionObject2D.collision_mask] in order to be detected. + For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. </description> </method> <method name="overlaps_area" qualifiers="const"> @@ -48,6 +50,9 @@ The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. See [member ProjectSettings.physics/2d/default_angular_damp] for more details about damping. </member> + <member name="angular_damp_space_override" type="int" setter="set_angular_damp_space_override_mode" getter="get_angular_damp_space_override_mode" enum="Area2D.SpaceOverride" default="0"> + Override mode for angular damping calculations within this area. See [enum SpaceOverride] for possible values. + </member> <member name="audio_bus_name" type="StringName" setter="set_audio_bus_name" getter="get_audio_bus_name" default="&"Master""> The name of the area's audio bus. </member> @@ -55,21 +60,30 @@ If [code]true[/code], the area's audio bus overrides the default audio bus. </member> <member name="gravity" type="float" setter="set_gravity" getter="get_gravity" default="980.0"> - The area's gravity intensity (in pixels per second squared). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction. + The area's gravity intensity (in pixels per second squared). This value multiplies the gravity direction. This is useful to alter the force of gravity without altering its direction. </member> - <member name="gravity_distance_scale" type="float" setter="set_gravity_distance_scale" getter="get_gravity_distance_scale" default="0.0"> - The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance. + <member name="gravity_direction" type="Vector2" setter="set_gravity_direction" getter="get_gravity_direction" default="Vector2(0, 1)"> + The area's gravity vector (not normalized). </member> <member name="gravity_point" type="bool" setter="set_gravity_is_point" getter="is_gravity_a_point" default="false"> - If [code]true[/code], gravity is calculated from a point (set via [member gravity_vec]). See also [member space_override]. + If [code]true[/code], gravity is calculated from a point (set via [member gravity_point_center]). See also [member gravity_space_override]. </member> - <member name="gravity_vec" type="Vector2" setter="set_gravity_vector" getter="get_gravity_vector" default="Vector2(0, 1)"> - The area's gravity vector (not normalized). If gravity is a point (see [member gravity_point]), this will be the point of attraction. + <member name="gravity_point_center" type="Vector2" setter="set_gravity_point_center" getter="get_gravity_point_center" default="Vector2(0, 1)"> + If gravity is a point (see [member gravity_point]), this will be the point of attraction. + </member> + <member name="gravity_point_distance_scale" type="float" setter="set_gravity_point_distance_scale" getter="get_gravity_point_distance_scale" default="0.0"> + The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance. + </member> + <member name="gravity_space_override" type="int" setter="set_gravity_space_override_mode" getter="get_gravity_space_override_mode" enum="Area2D.SpaceOverride" default="0"> + Override mode for gravity calculations within this area. See [enum SpaceOverride] for possible values. </member> <member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="0.1"> The rate at which objects stop moving in this area. Represents the linear velocity lost per second. See [member ProjectSettings.physics/2d/default_linear_damp] for more details about damping. </member> + <member name="linear_damp_space_override" type="int" setter="set_linear_damp_space_override_mode" getter="get_linear_damp_space_override_mode" enum="Area2D.SpaceOverride" default="0"> + Override mode for linear damping calculations within this area. See [enum SpaceOverride] for possible values. + </member> <member name="monitorable" type="bool" setter="set_monitorable" getter="is_monitorable" default="true"> If [code]true[/code], other monitoring areas can detect this area. </member> @@ -79,9 +93,6 @@ <member name="priority" type="float" setter="set_priority" getter="get_priority" default="0.0"> The area's priority. Higher priority areas are processed first. </member> - <member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" enum="Area2D.SpaceOverride" default="0"> - Override mode for gravity and damping calculations within this area. See [enum SpaceOverride] for possible values. - </member> </members> <signals> <signal name="area_entered"> @@ -101,27 +112,27 @@ <signal name="area_shape_entered"> <argument index="0" name="area_rid" type="RID" /> <argument index="1" name="area" type="Area2D" /> - <argument index="2" name="area_shape" type="int" /> - <argument index="3" name="local_shape" type="int" /> + <argument index="2" name="area_shape_index" type="int" /> + <argument index="3" name="local_shape_index" type="int" /> <description> Emitted when one of another Area2D's [Shape2D]s enters one of this Area2D's [Shape2D]s. Requires [member monitoring] to be set to [code]true[/code]. - [code]area_id[/code] the [RID] of the other Area2D's [CollisionObject2D] used by the [PhysicsServer2D]. + [code]area_rid[/code] the [RID] of the other Area2D's [CollisionObject2D] used by the [PhysicsServer2D]. [code]area[/code] the other Area2D. - [code]area_shape[/code] the index of the [Shape2D] of the other Area2D used by the [PhysicsServer2D]. - [code]local_shape[/code] the index of the [Shape2D] of this Area2D used by the [PhysicsServer2D]. + [code]area_shape_index[/code] the index of the [Shape2D] of the other Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]area.shape_owner_get_owner(area_shape_index)[/code]. + [code]local_shape_index[/code] the index of the [Shape2D] of this Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]self.shape_owner_get_owner(local_shape_index)[/code]. </description> </signal> <signal name="area_shape_exited"> <argument index="0" name="area_rid" type="RID" /> <argument index="1" name="area" type="Area2D" /> - <argument index="2" name="area_shape" type="int" /> - <argument index="3" name="local_shape" type="int" /> + <argument index="2" name="area_shape_index" type="int" /> + <argument index="3" name="local_shape_index" type="int" /> <description> Emitted when one of another Area2D's [Shape2D]s exits one of this Area2D's [Shape2D]s. Requires [member monitoring] to be set to [code]true[/code]. - [code]area_id[/code] the [RID] of the other Area2D's [CollisionObject2D] used by the [PhysicsServer2D]. + [code]area_rid[/code] the [RID] of the other Area2D's [CollisionObject2D] used by the [PhysicsServer2D]. [code]area[/code] the other Area2D. - [code]area_shape[/code] the index of the [Shape2D] of the other Area2D used by the [PhysicsServer2D]. - [code]local_shape[/code] the index of the [Shape2D] of this Area2D used by the [PhysicsServer2D]. + [code]area_shape_index[/code] the index of the [Shape2D] of the other Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]area.shape_owner_get_owner(area_shape_index)[/code]. + [code]local_shape_index[/code] the index of the [Shape2D] of this Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]self.shape_owner_get_owner(local_shape_index)[/code]. </description> </signal> <signal name="body_entered"> @@ -141,27 +152,27 @@ <signal name="body_shape_entered"> <argument index="0" name="body_rid" type="RID" /> <argument index="1" name="body" type="Node2D" /> - <argument index="2" name="body_shape" type="int" /> - <argument index="3" name="local_shape" type="int" /> + <argument index="2" name="body_shape_index" type="int" /> + <argument index="3" name="local_shape_index" type="int" /> <description> Emitted when one of a [PhysicsBody2D] or [TileMap]'s [Shape2D]s enters one of this Area2D's [Shape2D]s. Requires [member monitoring] to be set to [code]true[/code]. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s. - [code]body_id[/code] the [RID] of the [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [PhysicsServer2D]. + [code]body_rid[/code] the [RID] of the [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [PhysicsServer2D]. [code]body[/code] the [Node], if it exists in the tree, of the [PhysicsBody2D] or [TileMap]. - [code]body_shape[/code] the index of the [Shape2D] of the [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D]. - [code]local_shape[/code] the index of the [Shape2D] of this Area2D used by the [PhysicsServer2D]. + [code]body_shape_index[/code] the index of the [Shape2D] of the [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]body.shape_owner_get_owner(body_shape_index)[/code]. + [code]local_shape_index[/code] the index of the [Shape2D] of this Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]self.shape_owner_get_owner(local_shape_index)[/code]. </description> </signal> <signal name="body_shape_exited"> <argument index="0" name="body_rid" type="RID" /> <argument index="1" name="body" type="Node2D" /> - <argument index="2" name="body_shape" type="int" /> - <argument index="3" name="local_shape" type="int" /> + <argument index="2" name="body_shape_index" type="int" /> + <argument index="3" name="local_shape_index" type="int" /> <description> Emitted when one of a [PhysicsBody2D] or [TileMap]'s [Shape2D]s exits one of this Area2D's [Shape2D]s. Requires [member monitoring] to be set to [code]true[/code]. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s. - [code]body_id[/code] the [RID] of the [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [PhysicsServer2D]. + [code]body_rid[/code] the [RID] of the [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [PhysicsServer2D]. [code]body[/code] the [Node], if it exists in the tree, of the [PhysicsBody2D] or [TileMap]. - [code]body_shape[/code] the index of the [Shape2D] of the [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D]. - [code]local_shape[/code] the index of the [Shape2D] of this Area2D used by the [PhysicsServer2D]. + [code]body_shape_index[/code] the index of the [Shape2D] of the [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]body.shape_owner_get_owner(body_shape_index)[/code]. + [code]local_shape_index[/code] the index of the [Shape2D] of this Area2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with [code]self.shape_owner_get_owner(local_shape_index)[/code]. </description> </signal> </signals> |