Anim_AbsX

Category: Animations
Since engine version: 1.0 OC

Description

The value depends on the movement of the object into X direction. Every pixel the object moves into X direction increases the value a little bit. Once end has been reached the value is reset to begin. In contrast to Anim_X the value moves towards end not depending on whether the object moves to the left or to the right.

Syntax

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

Parameters

position:
Start value. Should be inside the interval given by begin and end.
begin:
Start of the interval.
end:
End of the interval. If end is greater than begin then the value increases with every movement of the object, otherwise it decreases.
length:
Number of pixels to be moved into X direction for the animation to be played from begin to end.

Remark

See the animation documentation for further explanations of the animation system.

Example

PlayAnimation("Walk", 5, Anim_AbsX(0, 0, GetAnimationLength("Walk"), 20), Anim_Const(1000));
Plays the animation "Walk" in slot 5, superimposing any other potential animations in slot 5. The animation is played the faster the faster the object moves into X direction. Once it moved 20 pixels the animation has been played from begin to end and restarts at its beginning.
See also: 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, 2010-01