Let's start with this simple gauge:
Code: Select all
<Gauge Name="ALT DISPLAY" Version="1.0"> <Image Name="NAV.bmp" ImageSizes="97,29"/> <Element> <Element> <Position X="5" Y="2"/> <Text X="87" Y="25" Bright="Yes" Length="6" Font="Quartz" Color="VIOLET" Adjust="Center" VerticalAdjust="Center" Multiline="No" Fixed="Yes"> <String>%((A:Autopilot altitude lock var, feet))%!05.0f!</String> </Text> </Element> </Element> <copyright>(c)2003 Ken Mitchell [email@example.com]</copyright> </Gauge>
<Image Name = /> - This one displays the gauge background. Only .bmp files are accepted.
<Element> </Element> - Introduces a new element. There are two here, one is a sub-element of the other. I would call them elemenception. This is useful in certain cases. Will explain later on. Please notice how it starts with a <Element> and closes with a </Element>
<Position /> - required to instruct where the element will lie. If there is already one in the previous element declaration, the datum is taken as that point. For example: if a <Position> in the first element is:
<Position X="5" Y="2"/>, then the first element will move to that point. If a sub-element is declared, like the example above and the position is set to be: <Position X="8" Y="5"/>, then the position of the sub-element is actually <Position X="13" Y="7"/> from the origin.
<Text/> : There is a tutorial explaining those terms at fs2x.com Link here: http://www.fs2x.com/Tutorials_files/XML ... 20V2_0.pdf
<String></String> - This is important. If you just type something between those lines, it will appear "as is" in fs. However, in the case above, what's happening is that an A:Var is being displayed, in this case being Autopilot Altitude lock. The % sign means that it needs to be evaluated. The !05.0f! means that it should display a maximum of 5 integers. Similar to this would be !3d!. Also, if !05.1f! was written, the number displayed would be of the form of XXXXX.X. Please note that A:Vars are not invented. These are taken either from here: http://www.fs2x.com/Tutorials_files/FS2 ... iables.txt or else: http://msdn.microsoft.com/en-us/library/cc526981.aspx.
The former are 100% compatible with FS9 whilst the latter are 100% compatible with FSX even though most of those listed in the latter are FS9 compatible.
Don't hesitate to post any queries you have below. This was a mini tutorial. I advise that you start by editing an XML gauge that you already have so that you avoid problems when putting them into FS.
NOTE: If syntax errors are present, e.g. a missin ">" or words spelt wrongly, the XML gauge will completely disappear from FS. If a gauge is small, like the one above, it might be easy to tackle the problem, but in cases were lines of code are 500+, it might be your worst nightmare. So proceed slowly and always confirm your last step to avoid further problems.