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

FSX CustomDraw using transparent background possible?

Messages
205
Country
netherlandsantilles
Dear all,
I'm still experimenting with the FS9GPS:MAP functions in FSX to max what is possible. I was wondering whether it is possible to have a "transparent' background draw within a fs9gps map section whenever you make use of the Customdraw function.
I read the excellent MAP guidebook and took notice off the several map overlay possibilities. But to be specific I want to use a mask within a Customdraw section as part of the gauge layers to mask part of the terrain map in the gauge but Not the waypoints info. I don't want the whole map in the background like the default FS GPS, but only part of it but at same time all the gps information on top. I don't see how I can do that with custom draw. OfCourse I can draw the terrain-map and overlay the gps-waypoints and stuff on top and do the mask declaration after the Customdraw section, but then it will mask also part of my waypoints, VORS, intersections etc etc that are behind the aircraft symbol (which of course I do not want).
I have also tried drawing the terrain map first (with customdraw), then mask it using a mask layer, and then afterwards draw another (separate) custom draw section with the gps- waypoints info. However I noticed that the terrain map will be completely overlaid by a black background whenever I draw the latter, which is the GPS and waypoint info. I know this has been done a thousand times but I'm still not getting it right or doesnt know how to do it with XML, (or is this only possible with C++?). Is there a way to turn off the "black map background or at least make it transparent (0,0,0,)?
Anybody can guide me into the right direction of how to mask only the map without masking the waypoint information or vice versa?
this is an example of what I want to achieve:
1535560838530.png

thnx,
Adino
 
Simply put in a "Terrain" button to toggle On/Off the terrain elevation colours .

Custom Draw
Code:
                        <CustomDrawParam id="LayerTerrain" Name="LayerTerrain">
                            <Value>(L:LayerTerrain) 1 &lt;</Value>
                        </CustomDrawParam>

Mouse switch button
Code:
               <MouseClick id="MouseClick">
                <Script>(L:LayerTerrain) 1 == if{ 0 (&gt;L:LayerTerrain) } els{ 1 (&gt;L:LayerTerrain) }</Script>
                </MouseClick>

Shot below shows same radar situation with Terrain On and Off .
Display is showing ,
Airports , VOR , NDB , Intersections , Flight Plan line and AI aircraft .

Cheers
Karol
capture_02062012_011046.jpg
 
Hi Karol,
Thanks for the feedback, I already can do that. I thought my question was clear enough. I want both layers displayed but with terrain layer masked and with the GPS info overlaying the masked terrain map.
Look at another example below:
1535566130682.png

both terrain and GPS info is shown here, however the terrain map is masked by the red boundary, but the GPS information is overlaid and NOT covered by the terrain mask.
Hope I explain myself better what I want to achieve. thankyou.
rgds,
Adino
 
Again a limit of XML. Unfortunately the FS9GPS custom draw doesn't support that.
 
Hi Karol,
Actually looking at your HUD display information on a transparent background, if there was a way to draw the GPS information similar way on a transparent background that would solve my problem.
 
Last edited:
Isn't this just a matter of layering?

First the display's background layer, then the GPS map with waypoint data, then a "not quite black (e.g. RGB 3,3,3) and black (RGB 1,1,1 for transparency)" image for masking the GPS map, then the HSI circle and then everything else.
 
agree with @Heretic , it just matter of layer.
bottom is map, above it is the black layer, above it nav data layer and soon. I believe you understand about render priority
 
Adino,

My two Rupiah worth - I agree with Jon (JB3DG) that this cannot be done using the XML CustomDraw parameters. At least, I know of no way, but definitely wish I did. To be specific, you cannot make the background appear transparent with respect to another object rendered beneath it, that is, drawn using XML script in the lines above CustomDraw fs9gps:map or another gauge . Not even with <LayerTerrain>0</LayerTerrain>, some transparent color choice for <BackgroundColor> or adding Transparency="0.x" in the CustomDraw definition. The background is opaque - some color, or just black, but, opaque. I'm speaking from an FSX viewpoint. I never know what LM might come up with in their next P3D release. They did add Departure and Arrival variables to the gps.dll starting with P3D v2 and didn't really mention it AFAIK, so maybe it's worth experimenting with the latest P3D to see if things have changed. Not hopeful.

To add a little historical perspective to this, it might be worth noting that when CustomDraw fs9gps:map first came out with FS9, it was in support of the introduction of the gps_500.xml gauge which was meant to be a near replica of the popular real world Garmin GPS500. The GPS500 had just a black background - not even the terrain elevation colors that can be selected in the gps_500.xml gauge by pressing the TERR button (which was not a feature of the original GPS500). Point being that MSFT may not have seen a need to dress up CustomDraw fs9gps:map flexibilities to exceed the capability of the GPS500 whose function they were replicating. Just my guess.

If you want to go to the effort, you might try creating your own overlay using XML drawing variables Polyline, Polygon, Rectangle and if you use FSX XML schema, I believe there are additional drawing vars available to you, but I see an immediate problem drawing lines connecting waypoints, like a flight plan route. Those points would have to be defined dynamically and that's a problem. I drew the TCAS traffic display in the picture below as an overlay - a separate <Element> scripted below the CustomDraw map code lines. I chose to show the map but alternatively, I could have displayed the traffic symbols in a HUD display.

By the way, I suggested to Tom Aguilo some time ago that he see if he could add an "XMLDraw" class to XMLTools - one that would draw dashed lines, dynamically controlled line points, etc., etc. I fear that I don't really know how to bribe him :)

Bob

1535586685104.png
 
Last edited:
@Heretic/Kalong,
Thanks for your feedback but I don't think it is just matter of layering, since I exhausted almost all options available without luck.
Just to add some perspective see my findings below.

This is my current map rendered on the MFD without the mask, notice the GPS waypoint info and line being draw behind the aircraft symbol.

1535591189050.png


This is the same map but with the mask image drawn after the Customdraw terrain map and Gps map being drawn in this order:
1) Terrain-map, 2) GPS -map, 3) Mask image, noticed now the GPS info (mark in red) that was in the previous image has been now masked as well.

1535591659524.png


Now, if I try to change order of the layers in the following order: 1)Terrain-map 2)Mask image 3) and Customdraw the GPS map, I got the following image:

1535592014958.png


It looks that the Customdrawn GPS Map, puts his own background layer on top of all the other layers.
So mine findings concede exactly with what Bob is trying to explain here and what JB3DG confirmed earlier.
It is OK I will have to leave it for what it is, thanks again all for clarifying this I thought I was doing something funky.
rgds,
Adino
 
There are lots of ways to skin a cat .... !

Perhaps a different or unusual way could be utilised to get what you want .

Visualise your display screen , cut it into two segments , Top half , and Bottom half .

TOP HALF ;
TOP half has one Custom Draw rendered with " (L:LayerTerrain) 1 "
It's " Focal point " is at the very bottom of that Custom Draw this one renders your terrain mapping .

BOTTOM HALF ;
Bottom half has Custom Draw rendered with " (L:LayerTerrain) 0 "
It's " Focal point " is at the very top of that Custom Draw this one does not render terrain mapping .

So you end up with two Custom Draws abutting , one at top half of display , other at lower half .
Both sections will display your overlay features , such as , Airports , Flight plan line ,
and if you want , VOR's , NDB's , Intersections , and AI aircraft .
...... but only the Top half will show the Terrain Elevation mapping .
Also zooms will be common to both .

It will work , and it will do exactly what you want .

Cheers
Karol
 
Hi Adino

You are welcome .

Be careful if you wish to be able to switch Off the Terrain in the Top half Custom Draw .
Presumably as follows ;

Top Half ,
Code:
                        <CustomDrawParam id="LayerTerrain" Name="LayerTerrain">
                            <Value>(L:LayerTerrain) 1 &lt;</Value>
                        </CustomDrawParam>

Bottom Half ,
Code:
                        <CustomDrawParam id="LayerTerrain" Name="LayerTerrain">
                            <Value>0</Value>
                        </CustomDrawParam>

It's only a guess , but , it will be easy to code it so that only the Top Layer Terrain will be changed/toggled by a click.

Cheers
Karol
 
Back
Top