オブジェクトの状態を変化させるアクションを定義するクラス。 本クラスのインスタンス生成にはTimeline#create()を利用する。

Constructors

Properties

_destroyedHandler: () => boolean
_loop: boolean
_modifiedHandler: () => void
_stale: boolean

Tween の削除可否を表すフラグ。 isFinished() はアクションが 0 個の場合に真を返さないが、後方互換性のためにこの挙動は変更せず、 _stale を用いて削除判定を行う。

_stepIndex: number
_target: any
paused: boolean

アクションの実行が一時停止状態かどうかを表すフラグ。 一時停止する場合はtrueをセットする。

Methods

  • アニメーションを実行する。

    Parameters

    • delta: number

      前フレームからの経過時間

    Returns void

  • オブジェクトの状態を変化させるアクションを追加する。 変化内容はアクション開始時を基準とした相対値で指定する。

    Parameters

    • props: any

      変化内容

    • duration: number

      変化に要する時間(ミリ秒)

    • easing: EasingType = Easing.linear

      Easing関数(指定しない場合はEasing.linear

    • multiply: boolean = false

      trueを指定するとpropsの値をアクション開始時の値に掛け合わせた値が終了値となる(指定しない場合はfalse

    Returns this

  • 関数を即座に実行するアクションを追加する。

    Parameters

    • func: () => void

      実行する関数

    Returns this

  • このTweenに追加されたすべてのアクションを取り消す。 reverttrue にした場合、ターゲットのプロパティをアクション開始前に戻す。 ただしTween#call()Tween#every()により変更されたプロパティは戻らない点に注意。

    Parameters

    • revert: boolean = false

      ターゲットのプロパティをアクション開始前に戻すかどうか (指定しない場合は false)

    Returns void

  • このTweenに追加されたすべてのアクションを即座に完了する。 Tween#looptrueの場合、ループの終端までのアクションがすべて実行される。

    Returns void

  • 次に追加されるアクションを、このメソッド呼び出しの直前に追加されたアクションと並列に実行させる。 Tween#con()で並列実行を指定されたアクションが全て終了後、次の並列実行を指定されていないアクションを実行する。

    Returns this

  • 待機時間をキーとして実行したい関数を複数指定する。

    Parameters

    • funcs: { [key: string]: () => void }

    Returns this

  • 指定した時間を経過するまで毎フレーム指定した関数を呼び出すアクションを追加する。

    Parameters

    • func: (e: number, p: number) => void

      毎フレーム呼び出される関数。第一引数は経過時間、第二引数はEasingした結果の変化量(0-1)となる。

    • duration: number

      変化に要する時間(ミリ秒)

    • easing: EasingType = Easing.linear

      Easing関数(指定しない場合はEasing.linear

    Returns this

  • ターゲットをフェードインさせるアクションを追加する。

    Parameters

    • duration: number

      変化に要する時間(ミリ秒)

    • easing: EasingType = Easing.linear

      Easing関数(指定しない場合はEasing.linear

    Returns this

  • ターゲットをフェードアウトさせるアクションを追加する。

    Parameters

    • duration: number

      変化に要する時間(ミリ秒)

    • easing: EasingType = Easing.linear

      Easing関数(指定しない場合はEasing.linear

    Returns this

  • アニメーションが終了しているかどうかを返す。 _targetが破棄された場合又は、全アクションの実行が終了した場合にtrueを返す。

    Returns boolean

  • ターゲットを指定した相対座標に移動するアクションを追加する。相対座標の基準値はアクション開始時の座標となる。

    Parameters

    • x: number

      x座標

    • y: number

      y座標

    • duration: number

      変化に要する時間(ミリ秒)

    • easing: EasingType = Easing.linear

      Easing関数(指定しない場合はEasing.linear

    Returns this

  • ターゲットを指定した座標に移動するアクションを追加する。

    Parameters

    • x: number

      x座標

    • y: number

      y座標

    • duration: number

      変化に要する時間(ミリ秒)

    • easing: EasingType = Easing.linear

      Easing関数(指定しない場合はEasing.linear

    Returns this

  • ターゲットのX座標を指定した座標に移動するアクションを追加する。

    Parameters

    • x: number

      x座標

    • duration: number

      変化に要する時間(ミリ秒)

    • easing: EasingType = Easing.linear

      Easing関数(指定しない場合はEasing.linear

    Returns this

  • ターゲットのY座標を指定した座標に移動するアクションを追加する。

    Parameters

    • y: number

      y座標

    • duration: number

      変化に要する時間(ミリ秒)

    • easing: EasingType = Easing.linear

      Easing関数(指定しない場合はEasing.linear

    Returns this

  • 一時停止するアクションを追加する。 内部的にはTween#call()Tween#pausedtrueをセットしている。

    Returns this

  • ターゲットをアクション開始時の角度を基準とした相対角度に回転するアクションを追加する。

    Parameters

    • angle: number

      角度

    • duration: number

      変化に要する時間(ミリ秒)

    • easing: EasingType = Easing.linear

      Easing関数(指定しない場合はEasing.linear

    Returns this

  • ターゲットを指定した角度に回転するアクションを追加する。

    Parameters

    • angle: number

      角度

    • duration: number

      変化に要する時間(ミリ秒)

    • easing: EasingType = Easing.linear

      Easing関数(指定しない場合はEasing.linear

    Returns this

  • ターゲットのアクション開始時の倍率に指定した倍率を掛け合わせた倍率に拡縮するアクションを追加する。

    Parameters

    • scaleX: number

      X方向の倍率

    • scaleY: number

      Y方向の倍率

    • duration: number

      変化に要する時間(ミリ秒)

    • easing: EasingType = Easing.linear

      Easing関数(指定しない場合はEasing.linear

    Returns this

  • ターゲットを指定した倍率に拡縮するアクションを追加する。

    Parameters

    • scaleX: number

      X方向の倍率

    • scaleY: number

      Y方向の倍率

    • duration: number

      変化に要する時間(ミリ秒)

    • easing: EasingType = Easing.linear

      Easing関数(指定しない場合はEasing.linear

    Returns this

  • アニメーションが削除可能かどうかを返す。 通常、ゲーム開発者がこのメソッドを呼び出す必要はない。

    Returns boolean

  • オブジェクトの状態を変化させるアクションを追加する。

    Parameters

    • props: any

      変化内容

    • duration: number

      変化に要する時間(ミリ秒)

    • easing: EasingType = Easing.linear

      Easing関数(指定しない場合はEasing.linear

    Returns this

  • オブジェクトの変化を停止するアクションを追加する。

    Parameters

    • duration: number

      停止する時間(ミリ秒)

    Returns this