|
@@ -1,6 +1,6 @@
|
|
:github_url: hide
|
|
:github_url: hide
|
|
|
|
|
|
-.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
|
|
|
|
|
|
+.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the Area2D.xml source instead.
|
|
.. DO NOT EDIT THIS FILE, but the Area2D.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
|
|
@@ -23,11 +23,11 @@ Tutorials
|
|
|
|
|
|
- :doc:`../tutorials/physics/using_area_2d`
|
|
- :doc:`../tutorials/physics/using_area_2d`
|
|
|
|
|
|
-- `2D Dodge The Creeps Demo <https://godotengine.org/asset-library/asset/515>`_
|
|
|
|
|
|
+- `2D Dodge The Creeps Demo <https://godotengine.org/asset-library/asset/515>`__
|
|
|
|
|
|
-- `2D Pong Demo <https://godotengine.org/asset-library/asset/121>`_
|
|
|
|
|
|
+- `2D Pong Demo <https://godotengine.org/asset-library/asset/121>`__
|
|
|
|
|
|
-- `2D Platformer Demo <https://godotengine.org/asset-library/asset/120>`_
|
|
|
|
|
|
+- `2D Platformer Demo <https://godotengine.org/asset-library/asset/120>`__
|
|
|
|
|
|
Properties
|
|
Properties
|
|
----------
|
|
----------
|
|
@@ -96,33 +96,33 @@ Emitted when another Area2D exits this Area2D. Requires :ref:`monitoring<class_A
|
|
|
|
|
|
.. _class_Area2D_signal_area_shape_entered:
|
|
.. _class_Area2D_signal_area_shape_entered:
|
|
|
|
|
|
-- **area_shape_entered** **(** :ref:`RID<class_RID>` area_rid, :ref:`Area2D<class_Area2D>` area, :ref:`int<class_int>` area_shape, :ref:`int<class_int>` local_shape **)**
|
|
|
|
|
|
+- **area_shape_entered** **(** :ref:`RID<class_RID>` area_rid, :ref:`Area2D<class_Area2D>` area, :ref:`int<class_int>` area_shape_index, :ref:`int<class_int>` local_shape_index **)**
|
|
|
|
|
|
Emitted when one of another Area2D's :ref:`Shape2D<class_Shape2D>`\ s enters one of this Area2D's :ref:`Shape2D<class_Shape2D>`\ s. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``.
|
|
Emitted when one of another Area2D's :ref:`Shape2D<class_Shape2D>`\ s enters one of this Area2D's :ref:`Shape2D<class_Shape2D>`\ s. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``.
|
|
|
|
|
|
-``area_id`` the :ref:`RID<class_RID>` of the other Area2D's :ref:`CollisionObject2D<class_CollisionObject2D>` used by the :ref:`Physics2DServer<class_Physics2DServer>`.
|
|
|
|
|
|
+``area_rid`` the :ref:`RID<class_RID>` of the other Area2D's :ref:`CollisionObject2D<class_CollisionObject2D>` used by the :ref:`Physics2DServer<class_Physics2DServer>`.
|
|
|
|
|
|
``area`` the other Area2D.
|
|
``area`` the other Area2D.
|
|
|
|
|
|
-``area_shape`` the index of the :ref:`Shape2D<class_Shape2D>` of the other Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`.
|
|
|
|
|
|
+``area_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of the other Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``area.shape_owner_get_owner(area_shape_index)``.
|
|
|
|
|
|
-``local_shape`` the index of the :ref:`Shape2D<class_Shape2D>` of this Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`.
|
|
|
|
|
|
+``local_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of this Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``self.shape_owner_get_owner(local_shape_index)``.
|
|
|
|
|
|
----
|
|
----
|
|
|
|
|
|
.. _class_Area2D_signal_area_shape_exited:
|
|
.. _class_Area2D_signal_area_shape_exited:
|
|
|
|
|
|
-- **area_shape_exited** **(** :ref:`RID<class_RID>` area_rid, :ref:`Area2D<class_Area2D>` area, :ref:`int<class_int>` area_shape, :ref:`int<class_int>` local_shape **)**
|
|
|
|
|
|
+- **area_shape_exited** **(** :ref:`RID<class_RID>` area_rid, :ref:`Area2D<class_Area2D>` area, :ref:`int<class_int>` area_shape_index, :ref:`int<class_int>` local_shape_index **)**
|
|
|
|
|
|
Emitted when one of another Area2D's :ref:`Shape2D<class_Shape2D>`\ s exits one of this Area2D's :ref:`Shape2D<class_Shape2D>`\ s. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``.
|
|
Emitted when one of another Area2D's :ref:`Shape2D<class_Shape2D>`\ s exits one of this Area2D's :ref:`Shape2D<class_Shape2D>`\ s. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``.
|
|
|
|
|
|
-``area_id`` the :ref:`RID<class_RID>` of the other Area2D's :ref:`CollisionObject2D<class_CollisionObject2D>` used by the :ref:`Physics2DServer<class_Physics2DServer>`.
|
|
|
|
|
|
+``area_rid`` the :ref:`RID<class_RID>` of the other Area2D's :ref:`CollisionObject2D<class_CollisionObject2D>` used by the :ref:`Physics2DServer<class_Physics2DServer>`.
|
|
|
|
|
|
``area`` the other Area2D.
|
|
``area`` the other Area2D.
|
|
|
|
|
|
-``area_shape`` the index of the :ref:`Shape2D<class_Shape2D>` of the other Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`.
|
|
|
|
|
|
+``area_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of the other Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``area.shape_owner_get_owner(area_shape_index)``.
|
|
|
|
|
|
-``local_shape`` the index of the :ref:`Shape2D<class_Shape2D>` of this Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`.
|
|
|
|
|
|
+``local_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of this Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``self.shape_owner_get_owner(local_shape_index)``.
|
|
|
|
|
|
----
|
|
----
|
|
|
|
|
|
@@ -148,33 +148,33 @@ Emitted when a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_
|
|
|
|
|
|
.. _class_Area2D_signal_body_shape_entered:
|
|
.. _class_Area2D_signal_body_shape_entered:
|
|
|
|
|
|
-- **body_shape_entered** **(** :ref:`RID<class_RID>` body_rid, :ref:`Node<class_Node>` body, :ref:`int<class_int>` body_shape, :ref:`int<class_int>` local_shape **)**
|
|
|
|
|
|
+- **body_shape_entered** **(** :ref:`RID<class_RID>` body_rid, :ref:`Node<class_Node>` body, :ref:`int<class_int>` body_shape_index, :ref:`int<class_int>` local_shape_index **)**
|
|
|
|
|
|
Emitted when one of a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`'s :ref:`Shape2D<class_Shape2D>`\ s enters one of this Area2D's :ref:`Shape2D<class_Shape2D>`\ s. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``. :ref:`TileMap<class_TileMap>`\ s are detected if the :ref:`TileSet<class_TileSet>` has Collision :ref:`Shape2D<class_Shape2D>`\ s.
|
|
Emitted when one of a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`'s :ref:`Shape2D<class_Shape2D>`\ s enters one of this Area2D's :ref:`Shape2D<class_Shape2D>`\ s. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``. :ref:`TileMap<class_TileMap>`\ s are detected if the :ref:`TileSet<class_TileSet>` has Collision :ref:`Shape2D<class_Shape2D>`\ s.
|
|
|
|
|
|
-``body_id`` the :ref:`RID<class_RID>` of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileSet<class_TileSet>`'s :ref:`CollisionObject2D<class_CollisionObject2D>` used by the :ref:`Physics2DServer<class_Physics2DServer>`.
|
|
|
|
|
|
+``body_rid`` the :ref:`RID<class_RID>` of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileSet<class_TileSet>`'s :ref:`CollisionObject2D<class_CollisionObject2D>` used by the :ref:`Physics2DServer<class_Physics2DServer>`.
|
|
|
|
|
|
``body`` the :ref:`Node<class_Node>`, if it exists in the tree, of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`.
|
|
``body`` the :ref:`Node<class_Node>`, if it exists in the tree, of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`.
|
|
|
|
|
|
-``body_shape`` the index of the :ref:`Shape2D<class_Shape2D>` of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>` used by the :ref:`Physics2DServer<class_Physics2DServer>`.
|
|
|
|
|
|
+``body_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>` used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``body.shape_owner_get_owner(body_shape_index)``.
|
|
|
|
|
|
-``local_shape`` the index of the :ref:`Shape2D<class_Shape2D>` of this Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`.
|
|
|
|
|
|
+``local_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of this Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``self.shape_owner_get_owner(local_shape_index)``.
|
|
|
|
|
|
----
|
|
----
|
|
|
|
|
|
.. _class_Area2D_signal_body_shape_exited:
|
|
.. _class_Area2D_signal_body_shape_exited:
|
|
|
|
|
|
-- **body_shape_exited** **(** :ref:`RID<class_RID>` body_rid, :ref:`Node<class_Node>` body, :ref:`int<class_int>` body_shape, :ref:`int<class_int>` local_shape **)**
|
|
|
|
|
|
+- **body_shape_exited** **(** :ref:`RID<class_RID>` body_rid, :ref:`Node<class_Node>` body, :ref:`int<class_int>` body_shape_index, :ref:`int<class_int>` local_shape_index **)**
|
|
|
|
|
|
Emitted when one of a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`'s :ref:`Shape2D<class_Shape2D>`\ s exits one of this Area2D's :ref:`Shape2D<class_Shape2D>`\ s. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``. :ref:`TileMap<class_TileMap>`\ s are detected if the :ref:`TileSet<class_TileSet>` has Collision :ref:`Shape2D<class_Shape2D>`\ s.
|
|
Emitted when one of a :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`'s :ref:`Shape2D<class_Shape2D>`\ s exits one of this Area2D's :ref:`Shape2D<class_Shape2D>`\ s. Requires :ref:`monitoring<class_Area2D_property_monitoring>` to be set to ``true``. :ref:`TileMap<class_TileMap>`\ s are detected if the :ref:`TileSet<class_TileSet>` has Collision :ref:`Shape2D<class_Shape2D>`\ s.
|
|
|
|
|
|
-``body_id`` the :ref:`RID<class_RID>` of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileSet<class_TileSet>`'s :ref:`CollisionObject2D<class_CollisionObject2D>` used by the :ref:`Physics2DServer<class_Physics2DServer>`.
|
|
|
|
|
|
+``body_rid`` the :ref:`RID<class_RID>` of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileSet<class_TileSet>`'s :ref:`CollisionObject2D<class_CollisionObject2D>` used by the :ref:`Physics2DServer<class_Physics2DServer>`.
|
|
|
|
|
|
``body`` the :ref:`Node<class_Node>`, if it exists in the tree, of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`.
|
|
``body`` the :ref:`Node<class_Node>`, if it exists in the tree, of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>`.
|
|
|
|
|
|
-``body_shape`` the index of the :ref:`Shape2D<class_Shape2D>` of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>` used by the :ref:`Physics2DServer<class_Physics2DServer>`.
|
|
|
|
|
|
+``body_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of the :ref:`PhysicsBody2D<class_PhysicsBody2D>` or :ref:`TileMap<class_TileMap>` used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``body.shape_owner_get_owner(body_shape_index)``.
|
|
|
|
|
|
-``local_shape`` the index of the :ref:`Shape2D<class_Shape2D>` of this Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`.
|
|
|
|
|
|
+``local_shape_index`` the index of the :ref:`Shape2D<class_Shape2D>` of this Area2D used by the :ref:`Physics2DServer<class_Physics2DServer>`. Get the :ref:`CollisionShape2D<class_CollisionShape2D>` node with ``self.shape_owner_get_owner(local_shape_index)``.
|
|
|
|
|
|
Enumerations
|
|
Enumerations
|
|
------------
|
|
------------
|
|
@@ -407,7 +407,9 @@ Method Descriptions
|
|
|
|
|
|
- :ref:`Array<class_Array>` **get_overlapping_areas** **(** **)** |const|
|
|
- :ref:`Array<class_Array>` **get_overlapping_areas** **(** **)** |const|
|
|
|
|
|
|
-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 :ref:`CollisionObject2D.collision_layer<class_CollisionObject2D_property_collision_layer>` must be part of this area's :ref:`CollisionObject2D.collision_mask<class_CollisionObject2D_property_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.
|
|
|
|
|
|
----
|
|
----
|
|
|
|
|
|
@@ -415,7 +417,9 @@ Returns a list of intersecting ``Area2D``\ s. For performance reasons (collision
|
|
|
|
|
|
- :ref:`Array<class_Array>` **get_overlapping_bodies** **(** **)** |const|
|
|
- :ref:`Array<class_Array>` **get_overlapping_bodies** **(** **)** |const|
|
|
|
|
|
|
-Returns a list of intersecting :ref:`PhysicsBody2D<class_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 :ref:`PhysicsBody2D<class_PhysicsBody2D>`\ s. The overlapping body's :ref:`CollisionObject2D.collision_layer<class_CollisionObject2D_property_collision_layer>` must be part of this area's :ref:`CollisionObject2D.collision_mask<class_CollisionObject2D_property_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.
|
|
|
|
|
|
----
|
|
----
|
|
|
|
|