class_world2d.rst 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the World2D.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_World2D:
  6. World2D
  7. =======
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. Class that has everything pertaining to a 2D world.
  10. Description
  11. -----------
  12. 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.
  13. Tutorials
  14. ---------
  15. - :doc:`Ray-casting <../tutorials/physics/ray-casting>`
  16. Properties
  17. ----------
  18. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  19. | :ref:`RID<class_RID>` | :ref:`canvas<class_World2D_property_canvas>` |
  20. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  21. | :ref:`PhysicsDirectSpaceState2D<class_PhysicsDirectSpaceState2D>` | :ref:`direct_space_state<class_World2D_property_direct_space_state>` |
  22. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  23. | :ref:`RID<class_RID>` | :ref:`navigation_map<class_World2D_property_navigation_map>` |
  24. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  25. | :ref:`RID<class_RID>` | :ref:`space<class_World2D_property_space>` |
  26. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  27. Property Descriptions
  28. ---------------------
  29. .. _class_World2D_property_canvas:
  30. - :ref:`RID<class_RID>` **canvas**
  31. +----------+--------------+
  32. | *Getter* | get_canvas() |
  33. +----------+--------------+
  34. The :ref:`RID<class_RID>` of this world's canvas resource. Used by the :ref:`RenderingServer<class_RenderingServer>` for 2D drawing.
  35. ----
  36. .. _class_World2D_property_direct_space_state:
  37. - :ref:`PhysicsDirectSpaceState2D<class_PhysicsDirectSpaceState2D>` **direct_space_state**
  38. +----------+--------------------------+
  39. | *Getter* | get_direct_space_state() |
  40. +----------+--------------------------+
  41. 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.
  42. ----
  43. .. _class_World2D_property_navigation_map:
  44. - :ref:`RID<class_RID>` **navigation_map**
  45. +----------+----------------------+
  46. | *Getter* | get_navigation_map() |
  47. +----------+----------------------+
  48. The :ref:`RID<class_RID>` of this world's navigation map. Used by the :ref:`NavigationServer2D<class_NavigationServer2D>`.
  49. ----
  50. .. _class_World2D_property_space:
  51. - :ref:`RID<class_RID>` **space**
  52. +----------+-------------+
  53. | *Getter* | get_space() |
  54. +----------+-------------+
  55. 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.
  56. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  57. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  58. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  59. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  60. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  61. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`