- Messages
- 58
I'm attempting to create a 3 way spring back gauge switches between volts and amps and could sure use some help. Animation works fine but the needle is not responding correctly. Any thoughts, greatly appreciated.
Wally
Wally
XML:
<PartInfo>
<Name>volt_ammeter_switch</Name>
<AnimLength>60</AnimLength>
<Animation>
<Parameter>
<Code>30 (L:VAmp, bool) 30 * + </Code>
<Lag>100</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>hand</Cursor>
<MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown+LeftRelease+RightRelease</MouseFlags>
<CallbackCode>
(M:Event) 'RightSingle' scmp 0 == if{ 1 (>L:VAmp, bool) }
(M:Event) 'LeftSingle' scmp 0 == if{ -1 (>L:VAmp, bool) }
(M:Event) 'RightRelease' scmp 0 ==
(M:Event) 'LeftRelease' scmp 0 == or
if{ 0 (>L:VAmp, bool) }
</CallbackCode>
</MouseRect>
</PartInfo>
<PartInfo>
<Name>volt_ammeter_needle</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>(L:VAmp, bool) 1 == if{ (A:ELECTRICAL MAIN BUS VOLTAGE, volts) 5 * } els{ (L:VAmp, bool) -1 == if{ (A:ELECTRICAL GENALT BUS VOLTAGE:1, volts) 5 * } els{ (A:ELECTRICAL GENALT BUS AMPS:1, amperes) 1.25 * }}</Code>
<Lag>100</Lag>
</Parameter>
</Animation>
</PartInfo>