class_world2d.rst 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the World2D.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_World2D:
  5. World2D
  6. =======
  7. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Class that has everything pertaining to a 2D world.
  12. Properties
  13. ----------
  14. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  15. | :ref:`RID<class_RID>` | :ref:`canvas<class_World2D_property_canvas>` |
  16. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  17. | :ref:`Physics2DDirectSpaceState<class_Physics2DDirectSpaceState>` | :ref:`direct_space_state<class_World2D_property_direct_space_state>` |
  18. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  19. | :ref:`RID<class_RID>` | :ref:`space<class_World2D_property_space>` |
  20. +-------------------------------------------------------------------+----------------------------------------------------------------------+
  21. Description
  22. -----------
  23. 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.
  24. Tutorials
  25. ---------
  26. - :doc:`../tutorials/physics/ray-casting`
  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:`VisualServer<class_VisualServer>` for 2D drawing.
  35. .. _class_World2D_property_direct_space_state:
  36. - :ref:`Physics2DDirectSpaceState<class_Physics2DDirectSpaceState>` **direct_space_state**
  37. +----------+--------------------------+
  38. | *Getter* | get_direct_space_state() |
  39. +----------+--------------------------+
  40. The state of this world's physics space. This allows arbitrary querying for collision.
  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.