PropertyAnimationクラス
PropertyAnimationは、開始値、終了値、および持続時間に従って拡張オブジェクトのプロパティを連続的に変化させます。
Animationはプロパティに対する連続的な変化を定義する関数と見なすことができます。変化のタイプはイージングカーブによって設定できます。
//We want to animate a GeoLocation to move 100 meters up in altitude // over a period of 10 seconds to simulate an elevator var elevatorAnimation = new AR.PropertyAnimation( geoLocation1, //the object geoLocation1 holds the animated property "altitude", //the property altitude will be animated 500, //the start value of the animation is 500 meters 600, //the resulting value of the animation is 600 meters 10000, //the duration of the elevator climb is 10 seconds (10000 miliseconds) easingCurve, //easing curve object to simulate acceleration and deceleration {onFinish : beepSound.play} //when finished, play a beep sound that elevator doors will now open );
コンストラクター
PropertyAnimation
-
target
-
property
-
start
-
end
-
duration
-
easingCurve
-
options
パラメーター:
-
target
ARchitectObjectアニメーション化されるプロパティを保持するオブジェクト。 AR.ARchitectObjectにする必要があります。
-
property
String連続的に変化させたい拡張オブジェクトのプロパティ名。
-
start
NumberPropertyAnimationの開始値。nullの場合はプロパティの現在の値が使用されます。注: 開始値としてnullを設定してPropertyAnimationを複数回ループさせた場合、初回のループが完了した後に値がリセットされないため、以降のループで値は変化しません。毎回ループ終了後に値をリセットするには、プロパティの現在の値を開始値として指定します。
-
end
NumberPropertyAnimationの終了値。nullにすることはできません。
-
duration
NumberPropertyAnimationの持続時間(ミリ秒単位)。値は負でなく、整数にする必要があります。
-
easingCurve
(デフォルト値:AR.EasingCurve("linear")
) EasingCurve オプションアニメーションの性質を記述するAR.EasingCurve。このパラメーターが省略されている場合、nullまたはundefinedに設定されている場合、またはtypeプロパティが含まれていない場合は、LINEARイージングカーブがデフォルト設定されます。
-
options
Object追加のオブジェクトプロパティをカスタマイズするためのパラメーター。
設定可能なプロパティは以下のとおりです。
メソッド
destroy
()
オブジェクトを破棄します。
isRunning
()
Boolean
Animationが現在実行中かどうかをチェックします。
戻り値:
Animationが現在実行されている場合はtrue。実行されていない場合はfalse。
pause
()
Animationを一時停止します。
PropertyAnimationが現在実行されていない場合、このメソッドを呼び出しても何も起こりません。
resume
()
Animationを再開します。
PropertyAnimationが現在実行されている場合、このメソッドを呼び出しても何も起こりません。それ以外の場合は、最後に一時停止された位置からAnimationが再開されるか、一時停止されていなかった場合は最初から開始されます。
start
-
loopTimes
Animationをただちに開始します。
パラメーター:
-
loopTimes
(デフォルト値:1
)Number オプションアニメーションの再生回数を指定します。負の値を指定すると無限にループします。整数にする必要があります。
stop
()
Animationをただちに停止します。Animationが自動的に停止する前に手動で停止することができます。手動で停止した場合、onFinishトリガーは発生しません。
プロパティ
イベント
onFinish
このトリガーは、Animationが完了したときに発生します。
このトリガーのデフォルト値はnullであり、トリガーが発生したときに何もアクションは実行されません。開発者はonFinishトリガーにカスタム関数を指定することで、カスタム機能を追加できます。
onStart
このトリガーは、Animationが開始する直前に発生します。
このトリガーのデフォルト値はnullであり、トリガーが発生したときに何もアクションは実行されません。開発者はonStartトリガーにカスタム関数を指定することで、カスタム機能を追加できます。