123456789101112131415161718192021222324252627282930313233 |
- // Learn TypeScript:
- // - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
- // Learn Attribute:
- // - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
- // Learn life-cycle callbacks:
- // - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html
- const { ccclass, property } = cc._decorator;
- @ccclass
- export default class NewClass extends cc.Component {
- @property(cc.Label)
- label: cc.Label = null;
- @property
- text: string = 'hello';
- // LIFE-CYCLE CALLBACKS:
- protected start(): void {
-
- }
- click() {
- window['clickbg']=this.node
- }
- clickbgItem() {
- window['clickbg'].getComponent(cc.Sprite).Sprite=this.node['sp1']
- }
- // update (dt) {}
- }
|