class_world2d.rst 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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:`Reference<class_Reference>` **<** :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:`../tutorials/physics/ray-casting`
  16. Properties
  17. ----------
  18. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  19. | :ref:`RID<class_RID>` | :ref:`canvas<class_World2D_property_canvas>` |
  20. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  21. | :ref:`Physics2DDirectSpaceState<class_Physics2DDirectSpaceState>` | :ref:`direct_space_state<class_World2D_property_direct_space_state>` |
  22. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  23. | :ref:`RID<class_RID>` | :ref:`space<class_World2D_property_space>` |
  24. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  25. Property Descriptions
  26. ---------------------
  27. .. _class_World2D_property_canvas:
  28. - :ref:`RID<class_RID>` **canvas**
  29. +----------+--------------+
  30. | *Getter* | get_canvas() |
  31. +----------+--------------+
  32. The :ref:`RID<class_RID>` of this world's canvas resource. Used by the :ref:`VisualServer<class_VisualServer>` for 2D drawing.
  33. ----
  34. .. _class_World2D_property_direct_space_state:
  35. - :ref:`Physics2DDirectSpaceState<class_Physics2DDirectSpaceState>` **direct_space_state**
  36. +----------+--------------------------+
  37. | *Getter* | get_direct_space_state() |
  38. +----------+--------------------------+
  39. 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.
  40. ----
  41. .. _class_World2D_property_space:
  42. - :ref:`RID<class_RID>` **space**
  43. +----------+-------------+
  44. | *Getter* | get_space() |
  45. +----------+-------------+
  46. The :ref:`RID<class_RID>` of this world's physics space resource. Used by the :ref:`Physics2DServer<class_Physics2DServer>` for 2D physics, treating it as both a space and an area.
  47. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  48. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  49. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`