This tutorial focuses on the Bright="Yes/No" for the default Lear 45 Backup Attitude gauge in Flight Simulator. Use this as informational source only.

-   Introduction   -

Welcome to another XML Gauge tutorial on the use of
Bright="Yes | No" statement in an <Image>   </Image> tag. This is continued from the XML - Backup Attitude Gauge tutorial, and I will also be using the bitmaps from the Lear_45.gau file.

FSFS Aircraft and Panel Design Forum user Etienne aka badderjet, asks:


"Well, making a custom night lighting bitmap appear when master batt&panel lights = ON was a simple task. At least for the background image. There I used an ICON... But how the heck should that work for e.g. a needle???"

One of the responses to his question, posted by a now inactive forum user, is quoted as follows:

I cannot see why IMAGE_BRIGHT would work any differently for C gauges as the equivalent tag of Bright="Yes" in XML. I simply coded the file so that that parameter is only used if the master battery AND the panel lights are ON.

IOW, I simply duplicated the entire section that defines that particular element's characteristics, and use either the OFF or ON section of the code, depending on the state of the two switches.

BTW, it is indeed LUMINOUS that will make the gauges (and anything else tagged with LUMINOUS 'pink' (or whatever color is specified in the panel.cfg file).

In fact, I had briefly toyed with the idea to use LUMINOUS as a 'dimmer' version of the gauge illumination, to provide three conditions:

  1. OFF
  2. DIM
      -   and   -
  3. BRIGHT

However, I got tired, and never bothered to implement it...


The panel lights are out due to panel electrical failures . . . this XML code enables the Backup Attitude gauge to remain illuminated! Unfortunately, the XML code will only function on the 2D cockpit as explained by AVSIM Forums Asst. VP, Models, Gauges Bill Leaming aka n4gix


In XML the tag is   Bright="Yes"   For example:

<Image Name="attitude_bu_bars.bmp" Bright="Yes" ImageSizes="82,30"/>


-   General Section Heading 1   -

Kritical GamerZ XML "Bright" Gauge Tutorial is kurrently under konstruction.

Simple XML OFF/ON switch using the L: variable

  1. First you make a command gauge (a click event)

    <Click>(L:switch1, bool) ! (&gt;L:switch1, bool)</Click>

  2. Then you make the bitmap part (it can be in the same directory or in another gauge file).

    <Visible>(L:switch1, bool)</Visible>

This is just one example to get the Value of the (&gt;L:...) variable. Of course, you can also do it with <Case Value="0">

If a mouse click triggers only one action, you can use:

<Click Event="..."/>

where as:

<Click> 0 (&gt;K:...)</Click>

does exactly the same, but you can use the second form to make more than one action at once. The (&gt;K:...) variable or event usually changes the state of FS, but can only read indirectly by associated A:... variables. Most (&gt;K:...) events don't need any "argument", so you can use 0 or <Click Event="..."/>.

NOTE: If this Web page doesn't render correctly it's because this Web site is optimized for FireFox! Internet Explorer users Please click here to view XML code.

Please send results/comments to:
raptor@kgz.shawbiz.ca

 

-   General Section Heading 2   -

^Top

Boolean algebra states that there are only 2 states (0 and 1), the parser for this form of XML accepts any number. It simply treats 0 as false and anything else as true. When it sets something to false, it sets it to 0. When it sets it to true, it sets it to the default of 1.

In XML, a single equals has no real meaning at all, but the double equals "==" is a question.

(L:x,bool) 1 == if{ 0 (>L:x,bool) }

NOTE: If this Web page doesn't render correctly it's because this Web site is optimized for FireFox!

 

-   Final XML   Lear45!Backup Attitude   -

^Top

<Gauge Name="Backup Attitude" Version="1.0" Author="KGZ">

<!-- Kopyright (C) 2003-06 Kritical GamerZ -->

<Image Name="attitude_bu_background.bmp" Luminous="No" UseTransparency="Yes" ImageSizes="104,104"/>

<Element>

<!-- Failures -->

<Failures>

<FAIL_GAUGE_ATTITUDE Action="0"/>

</Failures>

</Element>

<Element>

<MaskImage Name="attitude_bu_mask.bmp" UseTransparency="Yes" ImageSizes="104,104">

<Axis X="52" Y="52"/>

</MaskImage>

<Image Name="attitude_bu_ladder.bmp" ImageSizes="100,354">

<Axis X="50" Y="177"/>

</Image>

<Shift>

<Value Minimum="-90" Maximum="90">(A:Attitude indicator pitch degrees, degrees) /-/</Value>

<Scale Y="1.21"/>

</Shift>

<Rotate>

<Value>(A:Attitude indicator bank degrees, radians)</Value>

</Rotate>

</Element>

<Element>

<!-- Heading Bug -->

<Position X="52" Y="52"/>

<Image Name="attitude_bu_heading_bug.bmp" UseTransparency="Yes" ImageSizes="104,104">

<Axis X="52" Y="52"/>

</Image>

<Rotate>

<Value>(A:Attitude indicator bank degrees, radians)</Value>

</Rotate>

</Element>

<Element>

<!-- Bars -->

<Position X="22" Y="39"/>

<Select>

<Value>(A:ELECTRICAL MASTER BATTERY, bool)</Value>

<Case Value="0">

<Image Name="attitude_bu_bars.bmp" UseTransparency="Yes" ImageSizes="82,30"/>

</Case>

<Case Value="1">

<Image Name="attitude_bu_bars.bmp" Bright="Yes" UseTransparency="Yes" ImageSizes="82,30"/>

</Case>

</Select>

</Element>

^Top