请教如何用代码设置坐标

新手求助:点击一个按钮,设置精灵的坐标为(10,10),请教这个该怎么实现?

onBtnClick: function () {
var that = this;
console.log(’--------->button clickd!!’);
that.setHeroPos();
},

setHeroPos:function(){
    var that = this;
    console.log('--------->setHeroPos!!');
    console.log(that.hero);
    that.hero.node.x = 10;
    that.hero.node.y = 10;
},

这样写文化什么不行呢?

你要给这个精灵指定一个parent,就是要add进场景里面去才行

var that = this;

好高级的写法啊