openclonk/docs/sdk/script/fn/Anim_R.xml

51 lines
2.2 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>Anim_R</title>
<category>Animations</category>
<version>3.0 OC</version>
<syntax>
<rtype>array</rtype>
<params>
<param>
<type>int</type>
<name>begin</name>
<desc>Start of the interval.</desc>
</param>
<param>
<type>int</type>
<name>end</name>
<desc>End of the interval. If end is chosen to be greater than begin then the value increases with clockwise rotation, otherwise it decreases.</desc>
</param>
</params>
</syntax>
<desc>The value depends on the rotation of the object. Upward rotation (0 degrees) is mapped to the value given by begin, and moves toward end when the object rotates clockwise, up to end after one revolution (360 degrees).</desc>
<remark>See the <emlink href="definition/animations.html">animation documentation</emlink> for further explanations of the animation system.</remark>
<examples>
<example>
<code><funclink>PlayAnimation</funclink>(&quot;Turn&quot;, 5, <funclink>Anim_R</funclink>(0, <funclink>GetAnimationLength</funclink>(&quot;Turn&quot;)), <funclink>Anim_Const</funclink>(1000));</code>
<text>Plays the animation "Turn" in slot 5 and superimposes any other potential animations in slot 5. The animation is synchronized to the object's rotation so that the full animation is played once per revolution.</text>
</example>
</examples>
<related>
<funclink>PlayAnimation</funclink>
<funclink>SetAnimationPosition</funclink>
<funclink>SetAnimationWeight</funclink>
<funclink>Anim_Const</funclink>
<funclink>Anim_Linear</funclink>
<funclink>Anim_X</funclink>
<funclink>Anim_Y</funclink>
<funclink>Anim_AbsX</funclink>
<funclink>Anim_AbsY</funclink>
<funclink>Anim_Dist</funclink>
<funclink>Anim_XDir</funclink>
<funclink>Anim_YDir</funclink>
<funclink>Anim_Action</funclink>
</related>
</func>
<author>Clonk-Karl</author><date>2012-04</date>
</funcs>