mirror of
https://github.com/Leo501/CocosCreatorTutorial.git
synced 2026-05-08 22:57:36 +08:00
29 lines
521 B
JavaScript
29 lines
521 B
JavaScript
cc.Class({
|
|
extends: cc.Component,
|
|
|
|
properties: {
|
|
label: {
|
|
default: null,
|
|
type: cc.Label
|
|
},
|
|
// defaults, set visually when attaching this script to the Canvas
|
|
text: 'Hello, World!'
|
|
},
|
|
|
|
// use this for initialization
|
|
onLoad: function () {
|
|
this.label.string = this.text;
|
|
},
|
|
|
|
/**
|
|
*
|
|
*/
|
|
onBtn: function () {
|
|
cc.director.loadScene('Test');
|
|
},
|
|
|
|
// called every frame
|
|
update: function (dt) {
|
|
|
|
},
|
|
}); |