mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-05 14:10:19 +03:00
126 lines
4.9 KiB
ReStructuredText
126 lines
4.9 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. DO NOT EDIT THIS FILE!!!
|
||
.. Generated automatically from Godot engine sources.
|
||
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
|
||
.. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/World2D.xml.
|
||
|
||
.. _class_World2D:
|
||
|
||
World2D
|
||
=======
|
||
|
||
**继承:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
||
|
||
一种保存了所有 2D 世界组件的资源,例如画布和物理运算空间。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
描述
|
||
----
|
||
|
||
这个类包含所有与 2D 世界相关的内容:物理空间、可视场景和音频空间。2D 节点会将它们的资源注册到当前的 2D 世界中。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
教程
|
||
----
|
||
|
||
- :doc:`发射射线 <../tutorials/physics/ray-casting>`
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
属性
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-------------------------------------------------------------------+----------------------------------------------------------------------+
|
||
| :ref:`RID<class_RID>` | :ref:`canvas<class_World2D_property_canvas>` |
|
||
+-------------------------------------------------------------------+----------------------------------------------------------------------+
|
||
| :ref:`PhysicsDirectSpaceState2D<class_PhysicsDirectSpaceState2D>` | :ref:`direct_space_state<class_World2D_property_direct_space_state>` |
|
||
+-------------------------------------------------------------------+----------------------------------------------------------------------+
|
||
| :ref:`RID<class_RID>` | :ref:`navigation_map<class_World2D_property_navigation_map>` |
|
||
+-------------------------------------------------------------------+----------------------------------------------------------------------+
|
||
| :ref:`RID<class_RID>` | :ref:`space<class_World2D_property_space>` |
|
||
+-------------------------------------------------------------------+----------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
属性说明
|
||
--------
|
||
|
||
.. _class_World2D_property_canvas:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`RID<class_RID>` **canvas** :ref:`🔗<class_World2D_property_canvas>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- :ref:`RID<class_RID>` **get_canvas**\ (\ )
|
||
|
||
这个世界的画布资源的 :ref:`RID<class_RID>`\ 。由 :ref:`RenderingServer<class_RenderingServer>` 用于 2D 绘制。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_World2D_property_direct_space_state:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`PhysicsDirectSpaceState2D<class_PhysicsDirectSpaceState2D>` **direct_space_state** :ref:`🔗<class_World2D_property_direct_space_state>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- :ref:`PhysicsDirectSpaceState2D<class_PhysicsDirectSpaceState2D>` **get_direct_space_state**\ (\ )
|
||
|
||
直接访问该世界的物理 3D 空间状态。可用于查询当前和可能的碰撞。在多线程物理中使用时,仅可在主线程的 :ref:`Node._physics_process<class_Node_private_method__physics_process>` 中访问。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_World2D_property_navigation_map:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`RID<class_RID>` **navigation_map** :ref:`🔗<class_World2D_property_navigation_map>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- :ref:`RID<class_RID>` **get_navigation_map**\ (\ )
|
||
|
||
这个世界的导航地图的 :ref:`RID<class_RID>`\ 。由 :ref:`NavigationServer2D<class_NavigationServer2D>` 使用。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_World2D_property_space:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`RID<class_RID>` **space** :ref:`🔗<class_World2D_property_space>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- :ref:`RID<class_RID>` **get_space**\ (\ )
|
||
|
||
这个世界物理空间资源的 :ref:`RID<class_RID>`\ 。由 :ref:`PhysicsServer2D<class_PhysicsServer2D>` 用于 2D 物理,将其视为一个空间和一个区域。
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
|
||
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
|
||
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
|
||
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
|
||
.. |static| replace:: :abbr:`static (调用本方法无需实例,可直接使用类名进行调用。)`
|
||
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效运算符。)`
|
||
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列位标志构成位掩码的整数。)`
|
||
.. |void| replace:: :abbr:`void (无返回值。)`
|