World2D
继承: Resource
< RefCounted
< Object
A resource that holds all components of a 2D world, such as a canvas and a physics space.
描述
Class that has everything pertaining to a 2D world: A physics space, a canvas, and a sound space. 2D nodes register their resources into the current 2D world.
属性
属性说明
RID
canvas
RID
get_canvas ( )
The RID
of this world's canvas resource. Used by the RenderingServer
for 2D drawing.
PhysicsDirectSpaceState2D
direct_space_state
PhysicsDirectSpaceState2D
get_direct_space_state ( )
Direct access to the world's physics 2D space state. Used for querying current and potential collisions. When using multi-threaded physics, access is limited to Node._physics_process
in the main thread.
RID
navigation_map
RID
get_navigation_map ( )
The RID
of this world's navigation map. Used by the NavigationServer2D
.
RID
space
RID
get_space ( )
The RID
of this world's physics space resource. Used by the PhysicsServer2D
for 2D physics, treating it as both a space and an area.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。