UNPKG

@senspark/ee

Version:

utility library for cocos creator

53 lines (52 loc) 1.92 kB
/// <reference types="cocos-api" /> import { DialogManager } from './DialogManager'; declare type DialogEvent = (dialog: Dialog) => void; declare type Transition = cc.FiniteTimeAction; export declare enum DialogEventType { WillShow = 0, DidShow = 1, WillHide = 2, DidHide = 3 } export declare class Dialog extends cc.Component { private active; /** Used to run transtitions. */ private actor; private showingTransitions; private hidingTransitions; private eventDictionary; protected manager?: DialogManager; constructor(); onLoad(): void; getContainer(): cc.Node; /** Shows this dialog using the specified dialog manager. */ show(manager: DialogManager): void; /** Hides this dialog using the current dialog manager. */ hide(): void; /** Attempts to show the specified dialog using the current dialog manager. */ showDialog(dialog: Dialog): void; /** Checks whether this dialog is active. */ isActive(): boolean; /** Sets this dialog to be active. */ setActive(active: boolean): void; /** Adds a will-show event. */ onWillShow(event: DialogEvent): this; /** Adds a did-show event. */ onDidShow(event: DialogEvent): this; /** Adds a will-hide event. */ onWillHide(event: DialogEvent): this; /** Adds a did-hide event. */ onDidHide(event: DialogEvent): this; /** Adds a showing transition. */ addShowingTransition(transition: Transition): this; /** Adds a hiding transition. */ addHidingTransition(transition: Transition): this; playShowingTransition(callback: () => void): void; playHidingTransition(callback: () => void): void; private playTransition; addEvent(type: DialogEventType, event: DialogEvent): this; /** Processes all events for the specified event type. */ processEvent(type: DialogEventType): void; private getEvents; } export {};