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

2D gauge lighting

Messages
9
Country
unitedstates
I've seen several posts dealing with 2D gauge lighting but I can only find 1 (from 2008) that seems to come close to addressing the issue I have.

I'm re-writing all the gauges for the planes I own in order to effect more realistic gauge lighting. For example when the panel light is turned on, the entire face of my radio stack and the panel background should not light up... that would be a cabin light function.

The first main problem I ran into is that even when I'm dealing with a single gauge I run into bitmaps for lighted textures getting chunks taken out of them when a needle moves over them revealing the unlit texture which resides at a lower level.

For example:

bg.bmp

followed by

bg_panel_lit.bmp

followed by

Needle.bmp

followed by

Needle_Lit.bmp

Results in the gauge being drawn correctly (usually after the second or third time you flip the panel light switch only until the needle moves a bit at which time the area covered by 0x000000 in the Needle_Lit.bmp is erased revealing bg.bmp and effectively giving you a partially lit gauge.

What kind of different solutions have people come up with for this issue, or is that why I'm not really seeing lit gauges outside the virtual cockpit?

Thanks for looking,
Bao
 
XML

After the head injury I have not yet been able to teach myself C. I'm working on it but taking in large quantities of new information is quite a battle and the SDK seems disjointed and incomplete when it comes to learning. Even the information on I use for XML from the SDK is often wrong and as I understand it there are a lot of variables missing from the documentation as well as ones that are there which don't actually exist.

Thanks again,
Bao
 
To light up 2D gauges it's easier to use the Luminous setting. Here is an example where the lighting of the gauge is dependent on an L: variable (center panel gauge lights, which is controlled by a custom switch gauge), but you can use any variable you like to control this. The only difference in the two sets of code are the Luminous="Yes" parts. There have been even simpler ways to code this posted in this forum.

The color of the lighting is determined by the Luminous= line at the bottom of the panel.cfg file.

Code:
<Gauge Name="CYL HEAD TEMP 12" Version="1.0">
   <Image Name="CYL_TEMP_BACK.bmp" ImageSizes="300,300,300,300"/>

   <Element>
      <Visible>(L:CENT_LITE, bool) !</Visible>
      <Position X="0" Y="0"/>
      <Image Name="CYL_TEMP_FACE.bmp" ImageSizes="300,300,300,300"/>

   <Element>
    <Position X="64" Y="146"/>
      <Image Name="LEFT_ND.bmp" PointsTo="East" ImageSizes="86,9,86,9">
         <Axis X="0" Y="4.5"/>
      </Image>
      <Rotate>
         <Value Minimum="-50" Maximum="300">(L:CHT_1,number)</Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
         </Failures>
         <Nonlinearity>
            <Item Value="300" X="111" Y="64"/>
            <Item Value="200" X="136" Y="133"/>
            <Item Value="100" X="136" Y="166"/>
            <Item Value="0" X="128" Y="198"/>
            <Item Value="-50" X="110" Y="235"/>
         </Nonlinearity>
         <Delay DegreesPerSecond="45"/>
      </Rotate>
   </Element>
   <Element>
    <Position X="238" Y="146"/>
      <Image Name="RIGHT_ND.bmp" PointsTo="West" ImageSizes="86,9,86,9">
         <Axis X="86" Y="4.5"/>
      </Image>
      <Rotate>
         <Value Minimum="-50" Maximum="300">(L:CHT_2,number)</Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
         </Failures>
         <Nonlinearity>
            <Item Value="-50" X="188" Y="234"/>
            <Item Value="0" X="170" Y="199"/>
            <Item Value="100" X="162" Y="166"/>
            <Item Value="200" X="163" Y="134"/>
            <Item Value="300" X="188" Y="64"/>
         </Nonlinearity>
         <Delay DegreesPerSecond="45"/>
      </Rotate>
   </Element>

   </Element>


   <Element>
      <Visible>(L:CENT_LITE, bool)</Visible>
      <Position X="0" Y="0"/>
      <Image Name="CYL_TEMP_FACE.bmp" ImageSizes="300,300,300,300" Luminous="Yes"/>

   <Element>
    <Position X="64" Y="146"/>
      <Image Name="LEFT_ND.bmp" PointsTo="East" ImageSizes="86,9,86,9" Luminous="Yes">
         <Axis X="0" Y="4.5"/>
      </Image>
      <Rotate>
         <Value Minimum="-50" Maximum="300">(L:CHT_1,number)</Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
         </Failures>
         <Nonlinearity>
            <Item Value="300" X="111" Y="64"/>
            <Item Value="200" X="136" Y="133"/>
            <Item Value="100" X="136" Y="166"/>
            <Item Value="0" X="128" Y="198"/>
            <Item Value="-50" X="110" Y="235"/>
         </Nonlinearity>
         <Delay DegreesPerSecond="45"/>
      </Rotate>
   </Element>
   <Element>
    <Position X="238" Y="146"/>
      <Image Name="RIGHT_ND.bmp" PointsTo="West" ImageSizes="86,9,86,9" Luminous="Yes">
         <Axis X="86" Y="4.5"/>
      </Image>
      <Rotate>
         <Value Minimum="-50" Maximum="300">(L:CHT_2,number)</Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
         </Failures>
         <Nonlinearity>
            <Item Value="-50" X="188" Y="234"/>
            <Item Value="0" X="170" Y="199"/>
            <Item Value="100" X="162" Y="166"/>
            <Item Value="200" X="163" Y="134"/>
            <Item Value="300" X="188" Y="64"/>
         </Nonlinearity>
         <Delay DegreesPerSecond="45"/>
      </Rotate>
   </Element>

   </Element>

</Gauge>
 
Thanks for the response Tom,

Are you saying that the problem does not exist when you use luminous instead of bright? Because essentially that is what I'm up against. Up til now anyway I have been using bright for panel lighting and luminous for cabin lighting. If I need to change that practice now would be the time to do it.

Thanks,
Bao
 
Here is an example of simple gauge

Code:
<!-- Boost pressure gauge for Hawker Fury -->
<Gauge Name="boost_pressure" Version="1.0">
  <Image Name="boost_pressure_background.bmp"/>

  <Element>
    <Image Name="boost_pressure_face.bmp" Luminous="1"/>
  </Element>
  
  <Element>
    <Position X="75" Y="75"/>
    <Image Name="boost_pressure_needle.bmp" PointsTo="North" Luminous="1">
      <Axis X="4" Y="48"/>
    </Image>
    <Rotate>
      <Value Minimum="-4" Maximum="8">(A:Eng1 manifold pressure,boost psi)</Value>
      <Failures>
         <SYSTEM_ENGINE Action="0"/>
      </Failures>
      <Nonlinearity>
        <Item Value="-4" X="28" Y="67"/>
        <Item Value="-1" X="75" Y="27"/>
        <Item Value="3.5" X="123" Y="75"/>
        <Item Value="8" X="75 " Y="123"/>
      </Nonlinearity>
       <Delay DegreesPerSecond="90"/>
    </Rotate>
  </Element>

   <Mouse>
     <Tooltip ID="TOOLTIPTEXT_ENG1_MANIFOLD_PRESSURE_PSI"/>
   </Mouse>
</Gauge>


It uses the following entry in panel.cfg to set the colours

Code:
[Color]
Day=255,255,255
Night=233,108,107
Luminous=201,64,64

Day is the lighting colour applied during daytime (RGB)
Night is the lighting colour applied at night (RGB)
Luminous is the lighting colour applied to gauges that are luminous (RGB).
 
Back
Top