滚动条实现方法: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轴滚动,
同一个类中计划任务最好不要太多
例如计划任务
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轴滚动,
同一个类中计划任务最好不要太多
相关文章推荐
- 为Delphi程序增加UAC功能
- 第九周实践项目~猴子选大王
- 顺序串
- 第十一周 项目1-验证算法(1)
- 第九周实践项目2—对称矩阵压缩存储的实现与应用(1)
- 国内公有云对比(1)- 功能篇
- JAVA抽象类与接口的区别
- 第九周 稀疏矩阵的三元表示的实现
- 【软考之路】软考总结
- 第八周,建立顺序串的算法库。
- 利用Core Plot绘制柱状图
- tomcat配置https双向认证
- MySQL命令执行sql文件的两种方法
- 揭开Spring事务处理
- UI 学习 第一章 UIWindow UIview
- 一般处理程序ashx接收post参数
- jquery,js引入css文件,js引入头尾
- java面向对象之接口与多态
- 使用Cocos2d-lua开发植物大战僵尸06-僵尸类的实现
- kuangbin大牛的模板