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

Need Semi Transparent Background Help for XML HUD

Messages
137
Country
us-southcarolina
I'm working on a custom HUD and it's going well. In the original design I used a black (0,0,0) rectangle BMP as a background. To help separate the elements of the HUD from the sim background I wanted to create a "Tinted Glass" look in place of the regular transparent BG. I tried...

<Rectangle FillColor="#BABEC4" Width="600" Height="700" Bright="Yes" Transparency="0.85"/>

But get no love. If I remove the "Transparency" parameter the rectangle displays solid fine. If I set it to "0" it displays solid fine. But if i try to set the transparency I get nothing.
I tried several other thing and noticed that IF I had another object or image "behind" my "Glass" then the transparency from the rectangle would show up on top of it but not over the sim BG.

Am I doing something wrong or can you not use a vector rectangle as a semi transparent background?

If there is another way to achieve this I'd be game, I just want to end up with a semi transparent BG with my HUD element on top of it

Thanks
Joel
 
This thread, Sunshade, may be relevant. You can make the face of a gauge semi-transparent using Transparency, but If I remember correctly, making a semi-transparent layer on top of the external view may not be possible. Jan (phjvh) pushes XML about as far as anybody, and his novel solution to a shaded HUD is in response #10 of that thread.

Hope it helps,

Bob
 
Thanks for the replies. Still no love trying to do it directly in the XML gauge file. So I figured out a work around (seems like there is a lot of that with FSX).
I created another BG BMP the same size as the HUD. Made it the solid color that i wanted. Created a "HUD_BG.xml" gauge file to display the solid color BG BMP. Created another panel.cfg window entry using the "HUD_BG" gauge. There I could control the transparency using the "Alpha_Blend" setting and then added a "zorder" setting to the HUD panel and the HUD_BG Panel so the the HUD rendered on top of the BG Panel. Assigned both panels to the same key in FSUIPC. Kind of a kludge work around but it works and I can get with working on the HUD. After I'm finished I will revisit the in the XML gauge translucent BG issue. You would think there would be a way to do it.

thanks
Joel
 
Another follow up.... Given my solution above I would like to be able to setup a switch to turn the "Tinted Glass" effect on/off. What is the best way to control the display of a panel (ie on/off) from my XML Gauge ? Can you toggle the "Panel_8" sim var from an XML file? OR could I use a LUA script thru FSUIPC ? I see and offset for "Panel_8" in the FSUIPC manual. What would be the simplest approach given that once this is complete i want to be able to use it in several on my aircraft without too much tweeking with each aircraft other than what is needed to make the HUD conformal. ideas?

Thanks
Joel
 
Interesting work around. Would you kindly post the pertinent xml and panel.cfg? Thanks!
 
In XML,
Code:
(>K:PANEL_8)
should toggle panel 08. You can also toggle subpanels by using the ident= line in the panel.cfg file.
 
Interesting work around. Would you kindly post the pertinent xml and panel.cfg? Thanks!
Sure, the XML
Code:
<Gauge Name="HUD_BG" Version="1.0">
   <Element>
         <Update Frequency="18"/>
         <Visible>(A:ELECTRICAL MASTER BATTERY, bool) (A:AVIONICS MASTER SWITCH, bool) &amp;&amp; (L:HUD Power, bool) ! &amp;&amp;</Visible>
         <Image Name="HUD_BG.bmp" Bright="Yes" ImageSizes="600,700"/>
    </Element>
</Gauge>

Panel Config

Code:
[Window07]
Background_color=0,0,0
//position=1
visible=0
ident=15671
alpha_blend=0.35 // this gives me translucency
window_pos= 0, 0
window_size= 1.0, 1.0
size_mm=600, 700
zorder=2 //this makes sure is renders before the HUD

gauge00=JH_HUD!HUD_BG, 0, 0, 600, 700

Joel
 
In XML,
Code:
(>K:PANEL_8)
should toggle panel 08. You can also toggle subpanels by using the ident= line in the panel.cfg file.

Thanks,
Code:
(>K:PANEL_8)
worked prefect. Would using the id= method allow one to display panel over 09 ? I couldn't find any ref as to how to write that. Given you know the id number of a given panel what is the syntax to toggle it ?

Thanks
Joel
 
In FS9 format:

Code:
<Gauge Name="OVERHEAD_PANEL" Version="1.0">
   <Image Name="overhead.bmp" ImageSizes="80,40"/>
   <Mouse>
      <Cursor Type="Hand"/>
      <Click>250 (&gt;K:PANEL_ID_TOGGLE)</Click>
         <Tooltip ID="">Display/Hide Overhead</Tooltip>
         <Help ID=""/>
   </Mouse>
</Gauge>

The overhead.bmp is a small icon bitmap. The ident is 250, sometimes used by MS for overhead panels.

I don't know how to make a lower panel section appear above a higher one. Can you reverse the order of the sections?
 
Last edited:
Following is code to put into an Icon switch ,

Code:
<!--Left click switches both windows ON or Off
     Right click switches Tint background ON or OFF-->
    <Macro Name="Button1">(M:Event) 'LeftSingle' scmp 0 ==  if{ 1373 (>K:PANEL_ID_TOGGLE) } <!--Tint lwr zorder-->
                           (M:Event) 'LeftSingle' scmp 0 ==  if{ 11787 (&gt;K:PANEL_ID_TOGGLE) } <!--HUD Higher zorder-->
                           (M:Event) 'RightSingle' scmp 0 == if{ 1373 (>K:PANEL_ID_TOGGLE) } <!--Tint lwr zorder--></Macro>
     <Area Left="161" Top="37" Width="35" Height="25">
     <Tooltip>HUD and Tint</Tooltip>
     <Click Kind="LeftSingle+RightSingle" Repeat="Yes">@Button1</Click>
     <Cursor Type="Hand" />
     </Area>

Left click will toggle both (a) background tint window , and (b) HUD xml window , On or Off , the Tint window will be under the other as you require it .

Right click only toggles background tint window On or Off , that's the option that you require .

Cheers
Karol

PS
following is full gauge code ,
Tested with overlying windows , and it works .
Use your own Icon bitmap , and
use your own indent numbers .
Code:
<Gauge Name="clip_brdToggle.xml" Version="1.0">
   <Image Name="clip_brdT.bmp" ImageSizes="19,19"/>
   <Mouse>
      <Cursor Type="Hand"/>
    <Macro Name="Button1">(M:Event) 'LeftSingle' scmp 0 ==  if{ 1373 (>K:PANEL_ID_TOGGLE) }
                          (M:Event) 'LeftSingle' scmp 0 ==  if{ 11787 (&gt;K:PANEL_ID_TOGGLE) }
                          (M:Event) 'RightSingle' scmp 0 == if{ 1373 (>K:PANEL_ID_TOGGLE) }</Macro>       
     <Click Kind="LeftSingle+RightSingle" Repeat="Yes">@Button1</Click>
         <Tooltip ID=""> Clipboard </Tooltip>
   </Mouse>
</Gauge>
 
Last edited:
This is a little different from the original topic but thought I would add this on here before i started another thread...
I have another question about using my solution stated above. Currently I have my "tinted glass" background "gauge" in a separate panel that provides the transparency I wanted and renders it behind my HUD and i can turn it off/on using simple Shift+number key. That works. Now I want to control that from via a clickable switch on my HUD to do this while the gauge is in the same panel. I guess sort of gauges talking to each other. I guess I could go thru FSUIPC and write a lua script or something but what I would like to try is put both gauges in the same panel, still control the render order via the panel.cfg "draw_orderNN", but then the question is how to control a "visibility" statement in my HUD background gauge from my main HUD gauge. I was wondering if there are any user globally accessible (both read and write) variables that I can use for a "flag" that I can "set" in the HUD xml and "read" in the HUD Background xml ? If there are not any designed for direct user use I know that many aircraft designers will "hijack" some sim vars they are not using in their aircraft to use for different purposes. Is there a list some place of the more obscure sim vars that one could possibly use for that purpose ?

i guess my other goal here is to free up one of my shift+ keyable panels for other use.

Thanks

Joel
 
Last edited:
All L: variables are written and read from all gauges. That is what is commonly used when you need to communicate between gauges. Keep in mind the gauge must actually be loaded before the L: variables generated by that gauge can be read by other gauges. The two ways to get a gauge loaded is to have it visible on the screen (i.e. load the subpanel it is listed on) or place into a VCockpit section, which is always loaded.
 
All L: variables are written and read from all gauges.

Great. so I guess that means that 2 different gauges can't use the same Lvar name for different things but if one gauge writes to L:Flag1 the gauge02 can read L:Flag1 ??

....gauge must actually loaded.....place into a VCockpit section, which is always loaded.

So does this mean you can have a "gauge" that's not visiable or do anything visualy but is just a depository for Lvars and macros used by other gauges? so in the case do you not assign it a size or 0,0,0,0 ?

Thanks
Joel
 
So does this mean you can have a "gauge" that's not visiable or do anything visualy but is just a depository for Lvars and macros used by other gauges? so in the case do you not assign it a size or 0,0,0,0 ?

Thanks
Joel

NOT macros .

Macros are only read in the gauge that they are contained in , they are not visible to another gauge .

If you have two gauges and you want to utilise a macro , then you must have a complete copy of that macro in each of the two gauges .

Cheers
Karol
 
The answer is yes to both your questions.

If you want variables that are local to only that gauge you need to use G: variables, but there are a limited number of them and the names are fixed. Many don't bother, and instead use L: variables with specific name prefixes for each gauge. For example, in an RPM gauge each local L: variable could start with RPM_
 
Back
Top