Transitionの意味
【AS3入門】Tweenerのtransitionプロパティで使用する名称の意味独学ActionScriptでQuadって4じゃないの?なんで2なの?って書いてあって、同じこと思ったことがあったので補足。
TweenerやTweensyのコア部分は「時間から値を求める関数」を使って、プロパティの値を変化させている。
Tweenerはcaurina.transitions.Equationsクラスに関数が書いてある。Tweensyはfl.motion.easingパッケージ内のクラス群に関数が書いてある。
関数内の計算式は基本的に同じことをやっていて、引数も同じ。引数は t:Number, b:Number, c:Number, d:Number となっていて、その内訳は
t:Number– アニメーションが始まってからの時間(勝手にtimeの略だと思い込む)b:Number– アニメーションするプロパティの初期値(勝手にbeginの略だと思い込む)c:Number– アニメーションする量(勝手にchangeの略だと思い込む)d:Number– アニメーションする合計時間(勝手にdurationの略だと思い込む)
| 略称 | 意味 | クラス | easeIn関数の計算式 |
|---|---|---|---|
| Linear | 1次 | fl.motion.easing.Linear | c * t / d + b |
| Quad | 2次 | fl.motion.easing.Quadratic | c * (t /= d) * t + b |
| Cubic | 3次 | fl.motion.easing.Cubic | c * (t /= d) * t * t + b |
| Quart | 4次 | fl.motion.easing.Quartic | c * (t /= d) * t * t * t + b |
| Quint | 5次 | fl.motion.easing.Quintic | c * (t /= d) * t * t * t * t + b |
| Expo | 指数 | fl.motion.easing.Exponential | t == 0 ? b : c * Math.pow(2, 10 * (t / d - 1)) + b |
| Sine | 正弦 | fl.motion.easing.Sine | -c * Math.cos(t / d * (Math.PI / 2)) + c + b |
| Circ | 円形 | fl.motion.easing.Circular | -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b |
| Back | 逆行 | fl.motion.easing.Back | c * (t /= d) * t * ((s + 1) * t - s) + b(指定がなければ s = 1.70158) |
| Bounce | 跳返 | fl.motion.easing.Bounce | 分岐があるので省略 |
| Elastic | バネ | fl.motion.easing.Elastic | 分岐があるので省略 |
| 数学的な意味で順序付けしている(少なくとも1次~5次は) | |||
About this entry
You’re currently reading “Transitionの意味,” an entry on jp.ferv.blog
- Published:
- Wed, May 13th, 2009 at 11:48 AM
- Author:
- dsk
- Category:
- Web
- Tags:
- ActionScript 3.0, Tweener, Tweensy
5 Comments
Jump to comment form | comments rss | trackback uri