闪客动漫天地
欢迎 游客 , 注册 | 登录 | 会员 | 界面 | 简洁版本 | 在线 | 帮助
闪客动漫天地论坛

发表新主题 回复该主题
本主题被查看1001次, 共1个帖子, 1页, 当前为第1页     选择页数: 1      跳转到第   上一主题   下一主题
标题: Flash特效制作常用的源代码大放送 之六
版主
UID: 307061
来自:
精华: 0
积分: 376
帖子: 376
注册: 2007-6-13 13:01:00
状态: 离线
威望: 0.00
金钱: 68.05 元
只看楼主 2007-06-22 15:37
Flash特效制作常用的源代码大放送 之六
发点缓动函数 以下是引用片段:

  Math.linearTween=function(t,b,c,d){

  returnc*t/d+b;

  };

  //线性运动函数

  Math.easeInQuad=function(t,b,c,d){

  returnc*(t/=d)*t+b;

  };

  //二次缓入函数

  Math.easeOutQuad=function(t,b,c,d){

  return-c*(t/=d)*(t-2)+b;

  };

  //二次缓出函数

  Math.easeINOutQuad=function(t,b,c,d){

  if((t/=d/2)<1){

  returnc/2*t*t+b;

  }

  return-c/2*((--t)*(t-2)-1)+b;

  };

  //二次缓入缓出函数

  Math.easeInCubic=function(t,b,c,d){

  returnc*Math.pow(t/d,3)+b;

  };

  //三次缓入函数

  Math.easeOutCubic=function(t,b,c,d){

  returnc*(Math.pow(t/d-1,3)+1)+b;

  };

  //三次缓出函数

  Math.easeINOutCubic=function(t,b,c,d){

  if((t/=d/2)<1){

  returnc/2*Math.pow(t,3)+b;

  }

  returnc/2*(Math.pow(t-2,3)+2)+b;

  };

  //三次缓入缓出函数

  Math.easeInQuart=function(t,b,c,d){

  returnc*Math.pow(t/d,4)+b;

  };

  //四次缓入函数

  Math.easeOutQuart=function(t,b,c,d){

  return-c*(Math.pow(t/d-1,4)-1)+b;

  };

  //四次缓出函数

  Math.easeINOutQuart=function(t,b,c,d){

  if((t/=d/2)<1){

  returnc/2*Math.pow(t,4)+b;

  }

  return-c/2*(Math.pow(t-2,4)-2)+b;

  };

  //四次缓入缓出函数

  Math.easeInQuint=function(t,b,c,d){

  returnc*Math.pow(t/d,5)+b;

  };

  //五次缓入函数

  Math.easeOutQuint=function(t,b,c,d){

  returnc*(Math.pow(t/d-1,5)+1)+b;

  };

  //五次缓出函数

  Math.easeINOutQuint=function(t,b,c,d){

  if((t/=d/2)<1){

  returnc/2*Math.pow(t,5)+b;

  }

  returnc/2*(Math.pow(t-2,5)+2)+b;

  };

  //五次缓入缓出函数

  Math.easeInSine=function(t,b,c,d){

  returnc*(1-Math.cos(t/d*(Math.PI/2)))+b;

  };

  //正弦缓出函数

  Math.easeOutSine=function(t,b,c,d){

  returnc*Math.sin(t/d*(Math.PI/2))+b;

  };

  //正弦缓出函数

  Math.easeINOutSine=function(t,b,c,d){

  returnc/2*(1-Math.cos(Math.PI*t/d))+b;

  };

  //正弦缓入缓出函数

  Math.easeInExpo=function(t,b,c,d){

  returnc*Math.pow(2,10*(t/d-1))+b;

  };

  //指数缓入函数

  Math.easeOutExpo=function(t,b,c,d){

  returnc*(-Math.pow(2,-10*t/d)+1)+b;

  };

  //指数缓出函数

  Math.easeINOutExpo=function(t,b,c,d){

  if((t/=d/2)<1){

  returnc/2*Math.pow(2,10*(t-1))+b;

  }

  returnc/2*(-Math.pow(2,-10*--t)+2)+b;

  };

  //指数缓入缓出函数

  Math.easeInCirc=function(t,b,c,d){

  returnc*(1-Math.sqrt(1-(t/=d)*t))+b;

  };

  //圆形缓入函数

  Math.easeOutCirc=function(t,b,c,d){

  returnc*Math.sqrt(1-(t=t/d-1)*t)+b;

  };

  //圆形缓出函数

  Math.easeINOutCirc=function(t,b,c,d){

  if((t/=d/2)<1){

  returnc/2*(1-Math.sqrt(1-t*t))+b;

  }

  returnc/2*(Math.sqrt(1-(t-=2)*t)+1)+b;

  };

  //圆形缓入缓出函数
#1  
发表新主题 回复该主题
本主题被查看1001次, 共1个帖子, 1页, 当前为第1页     选择页数: 1      跳转到第







现在的时间是 2008-07-21 05:32:08
沪ICP备05003105号

版权所有 闪客俱乐部  
         Powered by Discuz!NT 1.0.6666    Copyright © 2001-2008 Comsenz Inc.
Processed in 0.384 seconds