mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 11:24:46 +00:00
36 lines
780 B
TypeScript
36 lines
780 B
TypeScript
import { _decorator, Component, Node } from 'cc';
|
|
import JNLayerBase from '../../../../../extensions/ngame/assets/ngame/ui/base/JNLayerBase';
|
|
import { app } from '../../../App';
|
|
import { Label } from 'cc';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
export interface TipsArgs{
|
|
text?:string; //内容
|
|
time?:number; //显示时间
|
|
}
|
|
|
|
@ccclass('TipsView')
|
|
export class TipsView extends JNLayerBase {
|
|
|
|
@property(Label)
|
|
text:Label;
|
|
|
|
onJNLoad(data: TipsArgs = {}): void {
|
|
if(!data) data = {};
|
|
|
|
data.text = data.text || "这是一个提示";
|
|
data.time = data.time || 3;
|
|
|
|
//显示弹窗内容
|
|
this.text.string = data.text;
|
|
|
|
this.scheduleOnce(() => {
|
|
this.onJNClose();
|
|
},data.time)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|