• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

A moving (sliding) element; how?

Messages
10,163
Country
us-arizona
Hey all,

This is for a 2D (FS2004 XML) gauge.

Lets say I have a screen, (like a Garmin G1000), and I have an icon object (Element or Bitmap) that I want to slide over when I click a button. How would that be written?

The icon would move over from one side of the screen to the other when you click on a spot. The part cannot just 'blink' to the new spot, it must slide over at a certain speed, be visibly moving across.
 
you familiar with <Shift><Value>? Construct an if{ ... process in <Update> that increments <Value> by some amount each update cycle. Alternatively, try incorporating a <Delay PixelsPerSecond="XX"/> within <Element> with no need for anything in <Update>, which would be much more elegant. Seems worth investigating - it ought to work.

Bob
 
Last edited:
dang... I wasnt thinking. Delay and a simple shift using an L:var, lol.. .

Many thanks Bob.
 
you still need to incorporate the mouse click condition that triggers movement whether the solution uses <Update> or all within <Element>
 
This is code for an oxgen blinker from a Lockheed Constellation. The blinker moves up and down automatically. Otherwise you need to look at code for primary instruments with flags.
Code:
<Gauge Name="Oxy Flow Indicator" Version="1.0">
   <Image Name="oxy_flow_indicator_bg.bmp"/>
   <Element>
      <Position X="40" Y="82"/>
      <Image Name="oxy_flow_indicator.bmp"/>
      <Shift>
         <Value>
         (A:Fuel total quantity,gallons) 0 &gt; if{ (A:Indicated Altitude,feet) 5000 &gt; if{ (P:Local time,seconds) 2 % } }
         </Value>
         <Nonlinearity>
            <Item Value="0" X="40" Y="103"/>
            <Item Value="1" X="40" Y="82"/>
            <Item Value="2" X="40" Y="103"/>
         </Nonlinearity>
      </Shift>
   </Element>
   <Element>
      <Position X="39" Y="93"/>
      <Image Name="oxy_flow_indicator_cover.bmp"/>
   </Element>
   <Mouse>
      <Tooltip ID="">Oxy Flow Indicator</Tooltip>
   </Mouse>
</Gauge>

This is a flag that covers the standby attitude indicator. It's the last layer in the gauge code.
Code:
<Element>
      <Position X="0" Y="0"/>
      <Select>
         <Value>(A:CIRCUIT GENERAL PANEL ON, bool) (A:CIRCUIT AVIONICS ON, bool) &amp;</Value>
         <Case Value="0">
            <Image Name="STANDBY_ATTITUDE_OFF.bmp" Luminous="1"/>
         </Case>
      </Select>
   </Element>
   <Mouse>
      <Tooltip ID="TOOLTIPTEXT_ATTITUDE_INDICATOR_BANK_PITCH"/>
   </Mouse>
 
Back
Top