class_world2d.rst 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_World2D:
  4. World2D
  5. =======
  6. **Inherits:** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Class that has everything pertaining to a 2D world.
  11. Member Functions
  12. ----------------
  13. +--------------------------------------------------------------------+----------------------------------------------------------------------------------+
  14. | :ref:`RID<class_rid>` | :ref:`get_canvas<class_World2D_get_canvas>` **(** **)** |
  15. +--------------------------------------------------------------------+----------------------------------------------------------------------------------+
  16. | :ref:`Physics2DDirectSpaceState<class_physics2ddirectspacestate>` | :ref:`get_direct_space_state<class_World2D_get_direct_space_state>` **(** **)** |
  17. +--------------------------------------------------------------------+----------------------------------------------------------------------------------+
  18. | :ref:`RID<class_rid>` | :ref:`get_sound_space<class_World2D_get_sound_space>` **(** **)** |
  19. +--------------------------------------------------------------------+----------------------------------------------------------------------------------+
  20. | :ref:`RID<class_rid>` | :ref:`get_space<class_World2D_get_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. Member Function Description
  26. ---------------------------
  27. .. _class_World2D_get_canvas:
  28. - :ref:`RID<class_rid>` **get_canvas** **(** **)**
  29. Retrieve the :ref:`RID<class_rid>` of this world's canvas resource. Used by the :ref:`VisualServer<class_visualserver>` for 2D drawing.
  30. .. _class_World2D_get_direct_space_state:
  31. - :ref:`Physics2DDirectSpaceState<class_physics2ddirectspacestate>` **get_direct_space_state** **(** **)**
  32. Retrieve the state of this world's physics space. This allows arbitrary querying for collision.
  33. .. _class_World2D_get_sound_space:
  34. - :ref:`RID<class_rid>` **get_sound_space** **(** **)**
  35. Retrieve the :ref:`RID<class_rid>` of this world's sound space resource. Used by the :ref:`SpatialSound2DServer<class_spatialsound2dserver>` for 2D spatial audio.
  36. .. _class_World2D_get_space:
  37. - :ref:`RID<class_rid>` **get_space** **(** **)**
  38. Retrieve 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.