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

来源:互联网 发布:oracle数据库日常备份 编辑:程序博客网 时间:2024/06/05 19:50
滚动条,方法: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轴滚动,
同一个类中计划任务最好不要太多
1 0
原创粉丝点击