拓展 / BaseView
BaseView Class
界面类的基类
Hierarchy
Table of contents
Accessors
holdBackTouch(value: boolean): void |
|---|
| 是否阻挡场景点击 |
isShow(): boolean |
| 判断界面是否处于显示状态 |
click
Accessors
canUpdate(): boolean client |
|---|
| 获取是否能触发 UI 中 onUpdate 生命周期函数 |
fullScreen(inFull: boolean): void client |
| 设置随父节点全屏适配,会验证父节点大小以保证跟随父节点的大小 |
layer(): number client |
| 获取 UI 的 Layer 层级 |
rootCanvas(): Canvas client |
| 获取 UI 的根 Canvas 节点 |
uiObject(): Widget |
| 获取 UI 顶层控件对象 |
uiWidgetBase(): UserWidget client |
| 获取 UI 顶层控件对象 |
visible(): boolean client |
| 获取 UI 是否显示 |
Methods
getCanvasChildren<T: extends Widget<T>>(canvas: Canvas, getType: TypeName<T: extends Widget<T>>): T: extends Widget<T>[] client |
|---|
| 根据类型获取画布下子对象序列 |
hide(): void client |
| 关闭全局唯一界面 |
show(...params: any[]): void client |
| 显示全局唯一界面 |
create<T: extends UIScript<T>>(): T: extends UIScript<T> client |
| 创建界面 |
hide(): void client |
| 关闭全局唯一界面 |
show(...params: any[]): void client |
| 显示全局唯一界面 |
click
Methods
destroy(): void client |
|---|
| 销毁 UI 对象 |
detectDrag(dragKey: Keys): EventReply client |
| 触发 DragDrop 事件的检测 |
detectDragIfPressed(inPointEvent: PointerEvent, dragKey: Keys): EventReply client |
| 事件检测通过,触发 DragDrop 事件的回复。 |
newDragDrop(inVisualWidget: Widget, inTag?: string, inPayLoad?: any, inPivot?: DragPivot, inOffset?: Vector2): DragDropOperation client |
| 创建 DragDrop 事件 |
remove(): void client |
| 移除 UI 对象 |
setVisible(inVisible: boolean SlateVisibility, ...params: any[]): void client |
| 设置 UI 是否显示 |
addBehavior(key: string, value: any): void client |
| 添加一个全局行为 |
clearBehavior(): void client |
| 清空全局一个行为 |
getBehavior(key: string): any client |
| 执行一个全局的行为 |
removeBehavior(key: string): void client |
| 移除全局一个行为 |
Accessors
holdBackTouch
• | ||
|---|---|---|
是否阻挡场景点击 Parameters
|
isShow
• |
|---|
判断界面是否处于显示状态 Returns |
boolean |
|---|
Methods
getCanvasChildren
• Protected getCanvasChildren<T>(canvas, getType): T[] client
根据类型获取画布下子对象序列
Parameters
canvas Canvas | 当前组件 |
|---|---|
getType TypeName<T> | 想要获取的类型 |
Returns
T[] | 所有符合类型的子对象 |
|---|
Type parameters
T | extends Widget<T> |
|---|
hide
• hide(): void client
关闭界面
show
• show(...params): void client
显示界面
Parameters
...params any[] | 参数序列,参数会传到界面的onShow生命周期方法中 |
|---|
Parameters
...params any[] | 参数序列,参数会传到界面的onShow生命周期方法中 |
|---|
create
• Static create<T>(): T client
创建界面
Returns
T | 界面对象 |
|---|
Type parameters
T | extends UIScript<T> |
|---|
hide
• Static hide(): void client
关闭全局唯一界面
show
• Static show(...params): void client
显示全局唯一界面
Precautions
这种方式会先创建一个全局唯一界面
Parameters
...params any[] | 参数序列,参数会传到界面的onShow生命周期方法中 |
|---|