class_world2d.rst 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.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. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Class that has everything pertaining to a 2D world.
  13. Properties
  14. ----------
  15. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  16. | :ref:`RID<class_RID>` | :ref:`canvas<class_World2D_property_canvas>` |
  17. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  18. | :ref:`Physics2DDirectSpaceState<class_Physics2DDirectSpaceState>` | :ref:`direct_space_state<class_World2D_property_direct_space_state>` |
  19. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  20. | :ref:`RID<class_RID>` | :ref:`space<class_World2D_property_space>` |
  21. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  22. Description
  23. -----------
  24. 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.
  25. Tutorials
  26. ---------
  27. - :doc:`../tutorials/physics/ray-casting`
  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:`VisualServer<class_VisualServer>` for 2D drawing.
  36. ----
  37. .. _class_World2D_property_direct_space_state:
  38. - :ref:`Physics2DDirectSpaceState<class_Physics2DDirectSpaceState>` **direct_space_state**
  39. +----------+--------------------------+
  40. | *Getter* | get_direct_space_state() |
  41. +----------+--------------------------+
  42. The state of this world's physics space. This allows arbitrary querying for collision.
  43. ----
  44. .. _class_World2D_property_space:
  45. - :ref:`RID<class_RID>` **space**
  46. +----------+-------------+
  47. | *Getter* | get_space() |
  48. +----------+-------------+
  49. 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.