class_world2d.rst 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/World2D.xml.
  6. .. _class_World2D:
  7. World2D
  8. =======
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A resource that holds all components of a 2D world, such as a canvas and a physics space.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Class that has everything pertaining to a 2D world: A physics space, a canvas, and a sound space. 2D nodes register their resources into the current 2D world.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - :doc:`Ray-casting <../tutorials/physics/ray-casting>`
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  25. | :ref:`RID<class_RID>` | :ref:`canvas<class_World2D_property_canvas>` |
  26. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  27. | :ref:`PhysicsDirectSpaceState2D<class_PhysicsDirectSpaceState2D>` | :ref:`direct_space_state<class_World2D_property_direct_space_state>` |
  28. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  29. | :ref:`RID<class_RID>` | :ref:`navigation_map<class_World2D_property_navigation_map>` |
  30. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  31. | :ref:`RID<class_RID>` | :ref:`space<class_World2D_property_space>` |
  32. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  33. .. rst-class:: classref-section-separator
  34. ----
  35. .. rst-class:: classref-descriptions-group
  36. Property Descriptions
  37. ---------------------
  38. .. _class_World2D_property_canvas:
  39. .. rst-class:: classref-property
  40. :ref:`RID<class_RID>` **canvas**
  41. .. rst-class:: classref-property-setget
  42. - :ref:`RID<class_RID>` **get_canvas** **(** **)**
  43. The :ref:`RID<class_RID>` of this world's canvas resource. Used by the :ref:`RenderingServer<class_RenderingServer>` for 2D drawing.
  44. .. rst-class:: classref-item-separator
  45. ----
  46. .. _class_World2D_property_direct_space_state:
  47. .. rst-class:: classref-property
  48. :ref:`PhysicsDirectSpaceState2D<class_PhysicsDirectSpaceState2D>` **direct_space_state**
  49. .. rst-class:: classref-property-setget
  50. - :ref:`PhysicsDirectSpaceState2D<class_PhysicsDirectSpaceState2D>` **get_direct_space_state** **(** **)**
  51. Direct access to the world's physics 2D space state. Used for querying current and potential collisions. When using multi-threaded physics, access is limited to :ref:`Node._physics_process<class_Node_private_method__physics_process>` in the main thread.
  52. .. rst-class:: classref-item-separator
  53. ----
  54. .. _class_World2D_property_navigation_map:
  55. .. rst-class:: classref-property
  56. :ref:`RID<class_RID>` **navigation_map**
  57. .. rst-class:: classref-property-setget
  58. - :ref:`RID<class_RID>` **get_navigation_map** **(** **)**
  59. The :ref:`RID<class_RID>` of this world's navigation map. Used by the :ref:`NavigationServer2D<class_NavigationServer2D>`.
  60. .. rst-class:: classref-item-separator
  61. ----
  62. .. _class_World2D_property_space:
  63. .. rst-class:: classref-property
  64. :ref:`RID<class_RID>` **space**
  65. .. rst-class:: classref-property-setget
  66. - :ref:`RID<class_RID>` **get_space** **(** **)**
  67. The :ref:`RID<class_RID>` of this world's physics space resource. Used by the :ref:`PhysicsServer2D<class_PhysicsServer2D>` for 2D physics, treating it as both a space and an area.
  68. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  69. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  70. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  71. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  72. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  73. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  74. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`