Commit 3581f880 authored by 范雪寒's avatar 范雪寒

feat: showlog

parent 56d3fee4
......@@ -1181,7 +1181,7 @@
"__id__": 7
},
"_enabled": true,
"alignMode": 1,
"alignMode": 2,
"_target": null,
"_alignFlags": 45,
"_left": 0,
......
......@@ -266,20 +266,34 @@ cc.Class({
},
showLog(str) {
console.log('str = ' + str);
if (!this.logList) {
this.logList = [];
}
this.logList.push(str);
if (this.logList.length == 1) {
this.showOneLog();
}
},
showOneLog() {
const str = this.logList.pop();
if (str === undefined) {
return;
}
const node = new cc.Node();
const label = node.addComponent(cc.RichText);
label.string = `<outline color=black width=3>${str}</outline>`;
label.maxWidth = this.node.width / 2;
// node.x = this.node.width / 2;
node.y = -this.node.height / 2;
node.parent = this.node;
cc.tween(node)
.to(5, { y: this.node.height })
.call(() => {
node.removeFromParent();
})
.removeSelf()
.start();
setTimeout(() => {
this.showOneLog();
}, 1000);
},
getRainbowColorList() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment