// Learn TypeScript: // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html // Learn Attribute: // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html // Learn life-cycle callbacks: // - https://docs.cocos.com/creator/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'; onLoad () { this.node.on(cc.Node.EventType.MOUSE_DOWN, this.move, this); } move() { //抓取節點 var node1 = cc.find("Canvas/大雄"); //緩動跳上 cc.tween(node1) //緩動跳上 .by(1, {position:cc.v3(0,400,0)}, {easing:"quartOut"}) //加速下墜 .by(1, {position:cc.v3(0,-400,0)}, {easing:"quartIn"}) .start(); } start () { } // update (dt) {} }