Anim_Dist

Kategorie: Animationen
Ab Engineversion: 6.0 OC

Beschreibung

The value depends on the distance travelled by the aboject. Every pixel the object moves increases the value a little bit. Once end has been reached the value is reset to begin. This is a combination of Anim_AbsX and Anim_AbsY, where the movement in both coordinates is considered.

Syntax

array Anim_Dist(int position, int begin, int end, int length);

Parameter

position:
Startwert. Sollte innerhalb des von begin und end aufgespannten Intervalls liegen.
begin:
Beginn des Intervalls.
end:
Schluss des Intervalls. Wenn end größer als begin ist, so nimmt der Wert mit der Bewegung des Objekts zu, andernfalls nimmt er ab.
length:
Number of pixels to be moved for the animation to be played from begin to end.

Anmerkung

Siehe die Animations-Dokumentation für eine Beschreibung des Animationssystems.

Beispiel

PlayAnimation("Fly", 5, Anim_Dist(0, 0, GetAnimationLength("Fly"), 20), Anim_Const(1000));
Plays the animation "Fly" in slot 5, superimposing any other potential animations in slot 5. The animation is played the faster the faster the object moves. Once it moved 20 pixels the animation has been played from begin to end and restarts at its beginning. This could be used for an engine animation of a flying object where the engine should only be animated as long as the object is moving.
Siehe auch: Anim_AbsX, Anim_AbsY, Anim_Action, Anim_Const, Anim_Dist, Anim_Linear, Anim_R, Anim_X, Anim_XDir, Anim_Y, Anim_YDir, PlayAnimation, SetAnimationPosition, SetAnimationWeight
Clonk-Karl, 2014-10