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

56 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_YDir</title>
<category>Animations</category>
<version>1.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 greater than begin then the value increases with increases XDir, otherwise it decreases.</desc>
</param>
<param>
<type>int</type>
<name>max_dir</name>
<desc>Highest value of the YDir to be mapped. All larger velocities lead to the same animation value (end).</desc>
</param>
</params>
</syntax>
<desc>The value is proportional to the object's velocity in Y direction. The velocities 0 to max_dir are mapped linearly to the interval given by begin and end.</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;ShowSpeed&quot;, 10, <funclink>Anim_YDir</funclink>(0, <funclink>GetAnimationLength</funclink>(&quot;ShowSpeed&quot;), 100), <funclink>Anim_Const</funclink>(1000));</code>
<text>Plays the animation "ShowSpeed" in slot 10. This could be a velocity display in an elevator.</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_R</funclink>
<funclink>Anim_AbsX</funclink>
<funclink>Anim_AbsY</funclink>
<funclink>Anim_Dist</funclink>
<funclink>Anim_XDir</funclink>
<funclink>Anim_Action</funclink>
</related>
</func>
<author>Clonk-Karl</author><date>2010-01</date>
</funcs>