const { ccclass, property } = cc._decorator; @ccclass /** * 提示管理类 * @author 邹勇 */ export default class TipSystem extends cc.Component { @property({ type: cc.Integer, displayName: "飘动时间" }) tween_time: number = 3; @property({ type: cc.Integer, displayName: "开始坐标x" }) src_x: number = 0; @property({ type: cc.Integer, displayName: "开始坐标y" }) src_y: number = 0; @property({ type: cc.Integer, displayName: "目标坐标x" }) tar_x: number = 0; @property({ type: cc.Integer, displayName: "目标坐标y" }) tar_y: number = 100; @property({ type: cc.Integer, displayName: "背景透明度" }) bg_opacity: number = 40; @property({ type: cc.Color, displayName: "背景颜色" }) bg_color: cc.Color = new cc.Color(200, 200, 200); @property({ type: cc.Color, displayName: "文本颜色" }) tip_color: cc.Color = new cc.Color(255, 255, 255); @property({ type: cc.Integer, displayName: "文本字体" }) tip_size: number = 40; private labels: cc.Label[]; onLoad() { mk.tip = this; this.labels = []; } start() { } public async pop(str: string) { let node = await mk.pool.getPrefab("game/prefab/tips"); let bg = node.getChildByName("bg"); let lbl = node.getChildByName("lbl"); bg.getComponent(cc.Sprite) console.log(node); } } export enum TipType { label = 1, }