平台游戏框架PlatformWorld本页总览PlatformWorld 描述: 带有物理模拟的2D平台游戏世界的类。 类对象:Platformer.PlatformWorld Class。 继承自:PhysicsWorld。 camera 类型: 只读成员变量。 描述: 用于控制游戏世界可见区域的相机。 签名: const camera: PlatformCamera moveChild 类型: 函数。 描述: 移动一个子节点到另一个游戏场景层。 签名: moveChild: function(self: PlatformWorld, child: Node, newOrder: integer) 参数: 参数名类型描述childNode要移动的子节点。newOrderinteger要移动到的游戏场景层的顺序编号。 getLayer 类型: 函数。 描述: 获取特定顺序编号的游戏场景层。 签名: getLayer: function(self: PlatformWorld, order: integer): Node 参数: 参数名类型描述orderinteger要获取的场景层的顺序编号。 返回值: 返回类型描述Node目标的游戏场景层节点。 setLayerRatio 类型: 函数。 描述: 设置特定游戏场景层的平移比率,用于模拟3D投影效果。 签名: setLayerRatio: function(self: PlatformWorld, order: integer, ratio: Vec2) 参数: 参数名类型描述orderinteger要设置的场景层的顺序编号。ratioVec2场景层的新平移比率。 getLayerRatio 类型: 函数。 描述: 获取特定游戏场景层的平移比率,用于模拟3D投影效果。 签名: getLayerRatio: function(self: PlatformWorld, order: integer): Vec2 参数: 参数名类型描述orderinteger要设置的场景层的顺序编号。 返回值: 返回类型描述Vec2场景层的平移比率. setLayerOffset 类型: 函数。 描述: 设置特定游戏场景层的位置偏移量。 签名: setLayerOffset: function(self: PlatformWorld, order: integer, offset: Vec2) 参数: 参数名类型描述orderinteger要设置偏移量的场景层的顺序编号。offsetVec2场景层的位置偏移量。 getLayerOffset 类型: 函数。 描述: Gets the position offset for a given layer. 签名: getLayerOffset: function(self: PlatformWorld, order: integer): Vec2 参数: 参数名类型描述orderintegerThe order of the layer to get the offset for. 返回值: 返回类型描述Vec2The position offset for the layer. swapLayer 类型: 函数。 描述: 交换两个游戏场景层的顺序。 签名: swapLayer: function(self: PlatformWorld, orderA: integer, orderB: integer) 参数: 参数名类型描述orderAinteger要交换的第一个场景层的顺序编号。orderBinteger要交换的第二个场景层的顺序编号。 removeLayer 类型: 函数。 描述: 从游戏世界中删除一个场景层。 签名: removeLayer: function(self: PlatformWorld, order: integer) 参数: 参数名类型描述orderinteger要删除的场景层的位置。 removeAllLayers 类型: 函数。 描述: 删除游戏世界中的所有场景层。 签名: removeAllLayers: function(self: PlatformWorld)