cc.Class({
extends: cc.Component,
properties: {
///
descRichText: cc.RichText,
},
// LIFE-CYCLE CALLBACKS:
onLoad () {
this.node.zIndex = 200;
},
init (noticeStr) {
let desc = noticeStr + '';
let stringArr = desc.split('n');
if (stringArr.length > 1) {
for (let i = 0; i < stringArr.length; ++ i) {
if (i == 0) {
desc = stringArr[0];
} else if (i < stringArr.length - 1) {
desc += '
' + stringArr[i];
} else {
desc += stringArr[i];
}
}
}
this.descRichText.string = `${desc}`;
},
start () {
},
hiddenAction() {
this.node.destroy();
}
// update (dt) {},
});