HelloWorld.js
1 window.Global = { 2 gint: 168, 3 }; 4 cc.Class({ 5 extends: cc.Component, 6 7 properties: { 8 label: { 9 default: null, 10 type: cc.Label 11 }, 12 // defaults, set visually when attaching this script to the Canvas 13 text: 'Hello, World!' 14 }, 15 16 // use this for initialization 17 onLoad: function () { 18 this.label.string = this.text; 19 20 }, 21 22 // called every frame 23 update: function (dt) { 24 25 }, 26 });