- 注册时间
- 2013-2-13
- 最后登录
- 2023-10-13
- 阅读权限
- 200
- 积分
- 9312
- 精华
- 1
- 帖子
- 2411
|
是要下面这种效果吗
http://lufylegend.com/demo/test/1.html
代码- init(50,"legend",480,800,main);
- var box;
- function main(){
- box = new LSprite();
- box.x = box.y = 100;
- addChild(box);
- box.graphics.drawArc(5,"#333333",[0,0,10,0,2*Math.PI],true,"#333333");
- toRight();
- }
- function toRight(){
- LTweenLite.to(box,1,
- {
- x:200,
- onComplete:toLeft,
- ease:Strong.easeOut
- });
- }
- function toLeft(){
- LTweenLite.to(box,1,
- {
- x:100,
- onComplete:toRight,
- ease:Strong.easeOut
- });
- }
复制代码 原理就是利用onComplete函数,在缓动结束时反复调用某函数,来实现循环。
|
|