Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 90874

请教如何用代码设置坐标

$
0
0

@111859 写道:

新手求助:点击一个按钮,设置精灵的坐标为(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;
},

这样写文化什么不行呢?

帖子: 3

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 90874

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>