Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
World2D
繼承: Resource < RefCounted < Object
一種保存了所有 2D 世界元件的資源,例如畫布和物理運算空間。
說明
這個類包含所有與 2D 世界相關的內容:物理空間、可視場景和音訊空間。2D 節點會將它們的資源註冊到目前的 2D 世界中。
教學
屬性
屬性說明
RID get_canvas()
這個世界的畫布資源的 RID。由 RenderingServer 用於 2D 繪製。
PhysicsDirectSpaceState2D direct_space_state 🔗
PhysicsDirectSpaceState2D get_direct_space_state()
直接存取該世界的物理 3D 空間狀態。可用於查詢目前和可能的碰撞。在多執行緒物理中使用時,僅可在主執行緒的 Node._physics_process() 中存取。
RID get_navigation_map()
這個世界的導覽地圖的 RID。由 NavigationServer2D 使用。
RID get_space()
這個世界物理空間資源的 RID。由 PhysicsServer2D 用於 2D 物理,將其視為一個空間和一個區域。