# Class LayerManager

界面层级管理器

#### Hierarchy

- LayerManager

- Defined in assets/core/gui/layer/LayerManager.ts:65

#####
Index

### Constructors

constructor

### Properties

camera
configs
dialog
game
guide
notify
popup
root
system
ui
uiMap

### Accessors

portrait

### Methods

clear
create_node
get
has
init
open
openAsync
remove
removeByNode
replace
replaceAsync
setConfig
setUIMap
toast
waitClose
waitOpen

## Constructors

### constructor

- new LayerManager(root: Node): LayerManager

- 构造函数

  #### Parameters

  - ##### root: Node

    界面根节点

  #### Returns LayerManager

  - Defined in assets/core/gui/layer/LayerManager.ts:382

## Properties

### camera

camera: Camera

界面摄像机

- Defined in assets/core/gui/layer/LayerManager.ts:69

### `Private` configs

configs: {
[key: number]: UIConfig ;
} = {}

UI配置

#### Type declaration

- ##### [key: number]: UIConfig

- Defined in assets/core/gui/layer/LayerManager.ts:88

### `Private` dialog

dialog: LayerDialog

只能弹出一个的弹窗

- Defined in assets/core/gui/layer/LayerManager.ts:82

### game

game: Node

游戏界面特效层

- Defined in assets/core/gui/layer/LayerManager.ts:71

### guide

guide: Node

新手引导层

- Defined in assets/core/gui/layer/LayerManager.ts:73

### `Private` notify

notify: LayerNotify

消息提示控制器，请使用show方法来显示

- Defined in assets/core/gui/layer/LayerManager.ts:86

### `Private` popup

popup: LayerPopUp

弹窗层

- Defined in assets/core/gui/layer/LayerManager.ts:80

### root

root: Node

界面根节点

- Defined in assets/core/gui/layer/LayerManager.ts:67

### `Private` system

system: LayerDialog

游戏系统提示弹窗

- Defined in assets/core/gui/layer/LayerManager.ts:84

### `Private` ui

ui: LayerUI

界面层

- Defined in assets/core/gui/layer/LayerManager.ts:78

### uiMap

uiMap: UIMap

界面地图

- Defined in assets/core/gui/layer/LayerManager.ts:75

## Accessors

### portrait

- get portrait(): boolean

- 是否为竖屏显示

  #### Returns boolean

  - Defined in assets/core/gui/layer/LayerManager.ts:91

## Methods

### clear

- clear(isDestroy?: boolean): void

- 清除所有窗口

  ### Example

      oops.gui.clear();

  #### Parameters

  - ##### isDestroy: boolean = false

    移除后是否释放

  #### Returns void

  - Defined in assets/core/gui/layer/LayerManager.ts:371

### `Private` create_node

- create_node(name: string): Node

- #### Parameters

  - ##### name: string

  #### Returns Node

  - Defined in assets/core/gui/layer/LayerManager.ts:405

### get

- get(uiId: number): Node

- 缓存中是否存在指定标识的窗口

  ### Example

      oops.gui.has(UIID.Loading);

  #### Parameters

  - ##### uiId: number

    窗口唯一标识

  #### Returns Node

  - Defined in assets/core/gui/layer/LayerManager.ts:266

### has

- has(uiId: number): boolean

- 缓存中是否存在指定标识的窗口

  ### Example

      oops.gui.has(UIID.Loading);

  #### Parameters

  - ##### uiId: number

    窗口唯一标识

  #### Returns boolean

  - Defined in assets/core/gui/layer/LayerManager.ts:235

### init

- init(configs: {
  [key: number]: UIConfig ;
  }): void

- 初始化所有UI的配置对象

  #### Parameters

  - ##### configs: {
    [key: number]: UIConfig ;
    }

    配置对象

    - ##### [key: number]: UIConfig

  #### Returns void

  - Defined in assets/core/gui/layer/LayerManager.ts:99

### open

- open(uiId: number, uiArgs?: any, callbacks?: UICallbacks ): void

- 同步打开一个窗口

  ### Example

      var uic: UICallbacks = {
         onAdded: (node: Node, params: any) => {
             var comp = node.getComponent(LoadingViewComp) as ecs.Comp;
         }
         onRemoved:(node: Node | null, params: any) => {

         }
      };
      oops.gui.open(UIID.Loading, null, uic);

  #### Parameters

  - ##### uiId: number

    窗口唯一编号

  - ##### uiArgs: any = null

    窗口参数

  - ##### `Optional` callbacks: UICallbacks

    回调对象

  #### Returns void

  - Defined in assets/core/gui/layer/LayerManager.ts:160

### openAsync

- openAsync(uiId: number, uiArgs?: any): Promise<null | Node>

- 异步打开一个窗口

  ### Example

      var node = await oops.gui.openAsync(UIID.Loading);

  #### Parameters

  - ##### uiId: number

    窗口唯一编号

  - ##### uiArgs: any = null

    窗口参数

  #### Returns Promise<null | Node>

  - Defined in assets/core/gui/layer/LayerManager.ts:190

### remove

- remove(uiId: number, isDestroy?: boolean): void

- 移除指定标识的窗口

  ### Example

      oops.gui.remove(UIID.Loading);

  #### Parameters

  - ##### uiId: number

    窗口唯一标识

  - ##### `Optional` isDestroy: boolean

    移除后是否释放

  #### Returns void

  - Defined in assets/core/gui/layer/LayerManager.ts:298

### removeByNode

- removeByNode(node: Node, isDestroy?: boolean): void

- 删除一个通过this框架添加进来的节点

  ### Example

      oops.gui.removeByNode(cc.Node);

  #### Parameters

  - ##### node: Node

    窗口节点

  - ##### `Optional` isDestroy: boolean

    移除后是否释放资源

  #### Returns void

  - Defined in assets/core/gui/layer/LayerManager.ts:328

### replace

- replace(removeUiId: number, openUiId: number, uiArgs?: any): void

- 场景替换

  #### Parameters

  - ##### removeUiId: number

    移除场景编号

  - ##### openUiId: number

    新打开场景编号

  - ##### uiArgs: any = null

    新打开场景参数

  #### Returns void

  - Defined in assets/core/gui/layer/LayerManager.ts:210

### replaceAsync

- replaceAsync(removeUiId: number, openUiId: number, uiArgs?: any): Promise<null | Node>

- 异步场景替换

  #### Parameters

  - ##### removeUiId: number

    移除场景编号

  - ##### openUiId: number

    新打开场景编号

  - ##### uiArgs: any = null

    新打开场景参数

  #### Returns Promise<null | Node>

  - Defined in assets/core/gui/layer/LayerManager.ts:221

### setConfig

- setConfig(uiId: number, config: UIConfig ): void

- 设置界面配置

  #### Parameters

  - ##### uiId: number

    要设置的界面id

  - ##### config: UIConfig

    要设置的配置

  #### Returns void

  - Defined in assets/core/gui/layer/LayerManager.ts:129

### setUIMap

- setUIMap(data: any): void

- 设置界面地图配置

  #### Parameters

  - ##### data: any

    界面地图数据

  #### Returns void

  - Defined in assets/core/gui/layer/LayerManager.ts:137

### toast

- toast(content: string, useI18n?: boolean): void

- 渐隐飘过提示

  ### Example

      oops.gui.toast("提示内容");

  #### Parameters

  - ##### content: string

    文本表示

  - ##### useI18n: boolean = false

    是否使用多语言

  #### Returns void

  - Defined in assets/core/gui/layer/LayerManager.ts:110

### waitClose

- waitClose(): void

- 关闭等待提示

  #### Returns void

  - Defined in assets/core/gui/layer/LayerManager.ts:120

### waitOpen

- waitOpen(): void

- 打开等待提示

  #### Returns void

  - Defined in assets/core/gui/layer/LayerManager.ts:115

Generated using TypeDoc