このクラスはenchant.jsでRobert Penner氏のActionScriptライブラリEasing EquationsをJavaScriptに移植したものを、さらにjgame.jsでTypeScriptに移植したものです。 より詳しい解説はenchant.jsのドキュメントも参照してください。 http://wise9.github.com/enchant.js/doc/core/ja/symbols/enchant.Easing.html 各種Easingがどのような効果を及ぼすかは、実際に動かして確認するのが一番ですが、下記のサンプルは多少理解の助けになるかもしれません。 http://jgame-js.sourceforge.jp/easing.html
このクラスはインスタンスを生成せず、静的なクラス関数を直接利用します。
static LINEAR(t, b, c, d) { --- static SWING(t, b, c, d) { --- static QUAD_EASEIN(t, b, c, d) { --- static QUAD_EASEOUT(t, b, c, d) { --- static QUAD_EASEINOUT(t, b, c, d) { --- static CUBIC_EASEIN(t, b, c, d) { --- static CUBIC_EASEOUT(t, b, c, d) { --- static CUBIC_EASEINOUT(t, b, c, d) { --- static QUART_EASEIN(t, b, c, d) { --- static QUART_EASEOUT(t, b, c, d) { --- static QUART_EASEINOUT(t, b, c, d) { --- static QUINT_EASEIN(t, b, c, d) { --- static QUINT_EASEOUT(t, b, c, d) { --- static QUINT_EASEINOUT(t, b, c, d) { --- static SIN_EASEIN(t, b, c, d) { --- static SIN_EASEOUT(t, b, c, d) { --- static SIN_EASEINOUT(t, b, c, d) { --- static CIRC_EASEIN(t, b, c, d) { --- static CIRC_EASEOUT(t, b, c, d) { --- static CIRC_EASEINOUT(t, b, c, d) { --- static ELASTIC_EASEIN(t, b, c, d, a, p) { --- static ELASTIC_EASEOUT(t, b, c, d, a, p) { --- static ELASTIC_EASEINOUT(t, b, c, d, a, p) { --- static BOUNCE_EASEOUT(t, b, c, d) { --- static BOUNCE_EASEIN(t, b, c, d) { --- static BOUNCE_EASEINOUT(t, b, c, d) { --- static BACK_EASEIN(t, b, c, d, s) { --- static BACK_EASEOUT(t, b, c, d, s) { --- static BACK_EASEINOUT(t, b, c, d, s) { --- static EXPO_EASEIN(t, b, c, d) { --- static EXPO_EASEOUT(t, b, c, d) { --- static EXPO_EASEINOUT(t, b, c, d) { --- static RANDOM() { この関数は、全てのEasing関数の中からランダムに一つを選んで返します。 Timelineに指定する際に、直接このメソッドを指定する事は出来ません。 このように、一度変数に格納してから指定する必要がある点に注意してください。
var easing = Easing.RANDOM(); entity.tl().moveTo(100, 100, 1000, easing);
---