class_world2d.rst 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. .. _class_World2D_property_direct_space_state:
  37. - :ref:`Physics2DDirectSpaceState<class_Physics2DDirectSpaceState>` **direct_space_state**
  38. +----------+--------------------------+
  39. | *Getter* | get_direct_space_state() |
  40. +----------+--------------------------+
  41. The state of this world's physics space. This allows arbitrary querying for collision.
  42. .. _class_World2D_property_space:
  43. - :ref:`RID<class_RID>` **space**
  44. +----------+-------------+
  45. | *Getter* | get_space() |
  46. +----------+-------------+
  47. 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.