您的位置:首页 > 其它

滚动条实现方法:action,计划任务

2015-11-09 17:01 232 查看
滚动条,方法:action,计划任务
例如计划任务
helloLabel:null,初始化

//滚动菜单
helloLabel = new cc.LabelTTF("看谁最长", "Arial", 38);
// position the label on the center of the screen
helloLabel.x = size.width / 2;
helloLabel.y = size.height-100;
// add the label as a child to this layer
this.addChild(helloLabel, 5);

this.schedule(this.LabelMove,0.2);

计划任务LabelMove : function(){
helloLabel.setPositionX(helloLabel.getPositionX()-10);
if(helloLabel.getPositionX() <= -50){
helloLabel.setPositionX(size.width);
}
}演x轴滚动,

同一个类中计划任务最好不要太多
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: