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

在onload里更新一个节点的位置问题

$
0
0

@1291940886 写道:

在onload里直接更新一个节点的位置,预览的时候没有效果,位置还是之前的。加上个定时器就可以,位置会变成设置的位置。
1. this.jinbichang.y = 0 + this.jinbichang.height / 2;

    2.    this.scheduleOnce(function() {  //暂时用定时器显示,上面那个正常的会失效,暂时不知道什么原因
            this.jinbichang.y = 0 + this.jinbichang.height / 2;
        }, 0);

第二个可以,第一个就不行,求大佬帮忙看下,一直琢磨不明白

帖子: 1

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88866

Trending Articles



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