// 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 { onLoad () { this.node.on("mousedown", this.show, this) } show() { //(1)get 節點/組件 var node = cc.find("Canvas/大雄/名字"); //let node:cc.Node = cc.find("Canvas/大雄/名字"); //(2)移動名字位置 node.setPosition(0, 300); } start () { } // update (dt) {} }