CocosCreator最新入門教程3.8穩(wěn)定版本由淺入深
2023-08-25 20:43 作者:truckmake大卡發(fā)車 | 我要投稿

/* 創(chuàng)建變量labelComp, get文本組件label */
const labelComp = this.node.getComponent(Label);
/* 打印我們的變量, 看是否正確get*/
console.log(labelComp);
/* 改變label的string值*/
labelComp.string='hello world!';
標(biāo)簽: