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

P3D v4 XML Dynamically sized dotted or dashed lines

Messages
27
Country
unitedstates
I'm trying to program my own GPS map display page. I would like to display a route with dashed lines between my waypoints (XMLVar lat and longs not stock waypoints). I want these lines to grow or shrink with the user-selected map scale. Due to technical reasons, I cannot use the stock map system so that's off limits.
Here's my idea:
  • Draw skinny bitmaps for different style lines: dotted, dashed, or solid. Additionally, use a black bitmap to act as a maskImage
  • Place a line bitmap at each waypoint X/Y and rotate it to point to the next waypoint
  • Use that black bitmap as a maskImage to trim off the excess line
  • Repeat for each waypoint
In theory, sounds easy. However, two problems arise:
  1. For some reason, maskImages can't be rotated.
  2. The maskImage should handle line segments that are shorter than the line bitmap, but how would I handle line segments that are longer than the line bitmap? Too much math to tile multiple line bitmaps...
Does anyone have any better ideas? If polyline allowed custom line types that would be perfect...
 
Last edited:
You have run into the limitation of XML I'm afraid. Only C++/GDI+ can do what you are wanting to do.
 
Yeah I think you're right. I was able to accomplish drawing solid lines with using verticalLine objects but their length limit is fixed. Is there anyway I can use polyLine for two Points but dynamically shift the locations of those points? Seems like Shift doesn't work with point objects.
 
IIRC, points for polylines may take values from macros, which in turn may take values from variables. Not entirely sure about this, but it could be worth trying out.
 
IIRC, points for polylines may take values from macros, which in turn may take values from variables. Not entirely sure about this, but it could be worth trying out.

Thanks for the idea! I just tried it and it doesn't work :/
XML:
<Point>
    <FloatPosition>@Test_X, @Test_Y</FloatPosition>
</Point>
 
It's FS9 XML syntax, mind you, but this works for me.

Code:
<Element><Polyline LineWidth="4" Color="black"><Axis X="0" Y="0"/><Point X="@GPU_Line_X1" Y="@GPU_Line_Y1"/><Point X="@GPU_Line_X2" Y="@GPU_Line_Y2"/></Polyline></Element>
 
It's FS9 XML syntax, mind you, but this works for me.

Code:
<Element><Polyline LineWidth="4" Color="black"><Axis X="0" Y="0"/><Point X="@GPU_Line_X1" Y="@GPU_Line_Y1"/><Point X="@GPU_Line_X2" Y="@GPU_Line_Y2"/></Polyline></Element>

Okay perfect! So clearly there's a way to get this to work. Do you know how that might be translated to the new XML syntax?
 
Working on it now and there doesn't seem to be a way to use macros in FloatPosition with FSX syntax. Strange that newer syntax would be more limited... so I'm hoping there's a way I don't know about yet.

Through trial and error I did discover something strange. You can use new lines instead of commas.

XML:
<Point>
    <FloatPosition>
        0
        0
    </FloatPosition>
</Point>
 
Last edited:
Back
Top