HelloWorld.js 426 B

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