import { _decorator, Component, Node, LabelComponent, SpriteComponent } from 'cc'; import { NoticeViewScript } from '../../../engines/notices/NoticeViewScript'; const { ccclass, property } = _decorator; @ccclass('TextNoticeView') export class TextNoticeView extends NoticeViewScript { @property({ type:LabelComponent }) label:LabelComponent=null; @property({ type:SpriteComponent }) background:SpriteComponent=null; start():void{ } OnStartMove():void{ this.label.string=this.data; } update(dt:number):void{ super.update(dt); this.background.node.width=this.label.node.width+24; this.background.node.height=this.label.node.height; } }