class_world2d.rst 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. Class that has everything pertaining to a 2D world.
  11. Description
  12. -----------
  13. Class that has everything pertaining to a 2D world. A physics space, a visual scenario and a sound space. 2D nodes register their resources into the current 2D world.
  14. Tutorials
  15. ---------
  16. - :doc:`Ray-casting <../tutorials/physics/ray-casting>`
  17. Properties
  18. ----------
  19. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  20. | :ref:`RID<class_RID>` | :ref:`canvas<class_World2D_property_canvas>` |
  21. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  22. | :ref:`PhysicsDirectSpaceState2D<class_PhysicsDirectSpaceState2D>` | :ref:`direct_space_state<class_World2D_property_direct_space_state>` |
  23. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  24. | :ref:`RID<class_RID>` | :ref:`navigation_map<class_World2D_property_navigation_map>` |
  25. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  26. | :ref:`RID<class_RID>` | :ref:`space<class_World2D_property_space>` |
  27. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  28. Property Descriptions
  29. ---------------------
  30. .. _class_World2D_property_canvas:
  31. - :ref:`RID<class_RID>` **canvas**
  32. +----------+--------------+
  33. | *Getter* | get_canvas() |
  34. +----------+--------------+
  35. The :ref:`RID<class_RID>` of this world's canvas resource. Used by the :ref:`RenderingServer<class_RenderingServer>` for 2D drawing.
  36. ----
  37. .. _class_World2D_property_direct_space_state:
  38. - :ref:`PhysicsDirectSpaceState2D<class_PhysicsDirectSpaceState2D>` **direct_space_state**
  39. +----------+--------------------------+
  40. | *Getter* | get_direct_space_state() |
  41. +----------+--------------------------+
  42. 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 ``_physics_process(delta)`` in the main thread.
  43. ----
  44. .. _class_World2D_property_navigation_map:
  45. - :ref:`RID<class_RID>` **navigation_map**
  46. +----------+----------------------+
  47. | *Getter* | get_navigation_map() |
  48. +----------+----------------------+
  49. The :ref:`RID<class_RID>` of this world's navigation map. Used by the :ref:`NavigationServer2D<class_NavigationServer2D>`.
  50. ----
  51. .. _class_World2D_property_space:
  52. - :ref:`RID<class_RID>` **space**
  53. +----------+-------------+
  54. | *Getter* | get_space() |
  55. +----------+-------------+
  56. 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.
  57. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  58. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  59. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  60. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  61. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  62. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`