Knob / slider animation: Difference between revisions

Jump to navigation Jump to search
no edit summary
mNo edit summary
No edit summary
Line 20: Line 20:


Note the animation is in active development, expect the API to evolve rapidly, However, it will only improve with use and feedback, so if you try it and don't like something, please say.
Note the animation is in active development, expect the API to evolve rapidly, However, it will only improve with use and feedback, so if you try it and don't like something, please say.
== Example ==
<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="utf8"?>
<PropertyList>
  <animation>
        <type>knob</type>
        <object-name>ALT-SEL</object-name>
        <value>0.0</value>
        <center>
            <x-m>0.0</x-m><y-m>0.027</y-m><z-m>0.0238</z-m>
        </center>
        <axis>
            <x>-1</x><y>0</y><z>0</z>
        </axis>
       
        <action>
            <binding>
                <command>property-adjust</command>
                <property>/autopilot/settings/target-altitude-ft</property>
                <factor>100</factor>
                <min>0</min>
                <max>40000</max>               
                <wrap>false</wrap>
            </binding>
        </action>
        <!-- explicit clockwise binding, action binding still runs too -->
        <cw>
            <binding>
                <command>nasal</command>
                <script>debug.dump('was increased', cmdarg().getNode('offset').getValue());</script>
          </binding>
        </cw>
        <!-- explicit anit-clockwise binding, action binding still runs too -->
        <ccw>
            <binding>....</binding>
        </ccw>
    </animation>
</PropertyList>
</syntaxhighlight>
580

edits

Navigation menu