• 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.

Dynamic lines

Messages
4
Country
sweden
I have created a display that shows drift in a helicopter in x and y. I show this by a square that moves over the gauge. So far no problems. Is there a way to use a dynamic line that moves in direction of the movement and that also change length depending on the drift speed.

Patrik
 
If you're meaning in XML then I think the only way to make the line appear to change length is to have two overlayed lines. Then move them in opposite directions lengthways (in addition to whatever translational movements you need) which means you can have the line variable between L and 2xL in length, where L is the length. If there is a neater way to do this then I am interested to hear it too!

Geoff
 
Thank you

Yes I mean in xml. Your suggestion could be one solution. I was also thinking in terms of scaling the line in some way. Any other solutions?
 
You can only scale a line in GDI+/Direct2D unfortunately....
 
I was also thinking along the lines of geoffco, but a mask that exposed more or less of a full length line as drift changed. Perhaps a circular shape with a 90 deg. sector removed from it that rotated clock/anticlock to progressively expose/hide the line either to the left or right.
 
You can use a rectangle with 'WidthCode' and/or 'HeightCode' parameters.
 
You can use a rectangle with 'WidthCode' and/or 'HeightCode' parameters.

That is in FS9 XML schema. That would be the equivalent to HeightScript and/or WidthScript in the FSX XML schema.

FS9 XML Schema example:
Code:
<Rectangle Width="258" Height="225" Color="0xF0D0D0" FillColor="Black" LineWidth="1" Bright="Yes">
	<HeightCode>(@g:popupMenuHeaderHeight) (@g:popupMenuMaxElements) (@g:popupMenuLineHeight) 17 * * + (@g:popupMenuHeight) min 4 +</HeightCode>
	<WidthCode>(@g:popupMenuWidth) 8 +</WidthCode>
</Rectangle>

FSX XML Schema example:
Code:
                    <Rectangle id="Rectangle">
                        <LineWidth>3</LineWidth>
                        <Bright>True</Bright>
                        <Width>200</Width>
                        <WidthScript>(@g:popupMenuWidth) 8 +</WidthScript>
                        <Height>250</Height>
                        <HeightScript>@PopupMenuTotalHeight</HeightScript>
                        <LineColor>Gray</LineColor>
                        <FillColor>Black</FillColor>
                    </Rectangle>
 
Last edited:
Thank you

The idea of using a rectangle was great. It works fine and I am now working on the rotation since it shall show drift in 360 degrees.
Thank you
 
Hello. I copied the above code (FS9 schema) and there is something I am missing because I was not able to get a rectangle to be movable. 1) It's apparent I don't know what the @g: is. I tried adding:
<Macro Name="g">C:fs9gps</Macro> but nothing. Attempt #2 I made Macros for the parameters and stuck in a simple variable but did not observe any movement. For example:

<Macros Name="Width">A:GPS GROUND SPEED, knots</Macro>
<WidthCode>@Width</WidthCode>

If rectangles can be movable, can arcs too?
 
Back
Top