FSX FSX XML Schema question

In FS9 FormattedText XML schema, one can list multiple font colors, font faces, and font sizes and then select which one to display by using the appropriate escape sequence. For example:

XML:
<FormattedText X="440" Y="222" Font="consolas" FontSize="8" LineSpacing="8" Color="#101010" BackgroundColor="gainsboro" Bright="Yes" Align="Right">
<Color Value="blue"/><Color Value="red"/><Font Name="consolas italic"/><Font FontSize="10"/>
    <String>
        %\{clr2}----------------- NearestVorCurrent -----------------\n
        %      ICAO     \{clr5}111\{clr2}\n
        Line  \{clr2}1\{clr4}23\{clr3}4567\{clr5}89012\{clr2}  Ident Type\n
        %((@c:NearestVorItemsNumber) s2 0 !=)
                %{if}
                    %((L:ScrollIncrement, enum) int sp1)
                    %{loop}
                        %(l1 (>@c:NearestVorCurrentLine))\{lsp=24}\{clr}
                            %((@c:NearestVorCurrentICAO) 'SelectedVORICAO' @FIRString scmp 0 ==)%{if}\{clr4}%{end}
                            ...
                            ...
                            ...
    </String>
</FormattedText>
I presume that the escape sequences documented in the link are valid under both FS9 and FSX schema formats.

Question: How does one write the alternate color/size/font choices in FSX schema format? What is the syntax?

XML:
<GaugeText><Bold>false</Bold><Bright>false</Bright><FontColor>#FFFFFF</FontColor><FontFace>OCR-A II</FontFace><FontHeightScript>17</FontHeightScript>
<Length>130</Length><HorizontalAlign>LEFT</HorizontalAlign><Size>150,25</Size><HeightScript>147</HeightScript><WidthScript>240</WidthScript><Tabs>0,30,108,175,205</Tabs><Transparent>true</Transparent>
    *What goes here?*
  
    <GaugeString>
        %((L:JoystickButtonScroll, enum) 9 + (C:ITrafficInfo:ListSize) min s2)
        %{if}%((L:JoystickButtonScroll, enum) 8 / int 8 * sp1)
            %{loop}
                %(l1)
                    %(l1 d (>C:ITrafficInfo:CurrentVehicle) (>C:ITrafficInfo:SelectedVehicle))
                    %((C:ITrafficInfo:SelectedVehicleID) 1 ==)%{if}\{clr2}%{end}
                    %((C:ITrafficInfo:SelectedVehicleID) (L:VehicleID) == )%{if}\{rev}\{blc=olivedrab}%{end}
                    \{clr}%((C:ITrafficInfo:CurrentVehicle) 1 +)%!2d!
                    \t%( @CurrentCallsign )%!s!
                    ...
                    ...
                    ...
    </GaugeString>
</GaugeText>
Bob
 
Last edited:

Heretic

Resource contributor
This is the only example I could find quickly:
Code:
<AlternateColor id="AlternateColor">
<FontColor>ORANGE</FontColor>
</AlternateColor>

<AlternateFont>
<FontFace>GLASS GAUGE</FontFace>
<FontHeight>18</FontHeight>
</AlternateFont>
Not sure whether multiple alternate colors (up to 7 for FS9 schema, IIRC) require their own wrapping "alternatecolor" tag or it suffices to add them to the list by their "fontcolor" tags.
 
Excellent! Thanks Bjoern.

I had a hunch you would respond. You're the only one I know that has the patience to work with FSX schema.

After reading your response, I took a more careful look at the online SDK. It's in there - just buried a little further down than I looked at first.

Bob
 
Last edited:
Just another example , used in a Loop in my radar .
( It was done in two parts , (1) readout section , and (2) loop calculation . )
Code:
    <!--Target selected AI Lock    %\{clr=@AiFontColor}  On-->
        <Element id="Target_Data">
                    <FloatPosition>0.000,0.000</FloatPosition>
                    <Visibility>(L:TGTscript, number) 1 ==</Visibility> 
                <Element id="Target_Data">
                    <FloatPosition>0.000,30.000</FloatPosition>
                    <GaugeText id="target">
                        <BackgroundColorScript>0x000000</BackgroundColorScript>
                        <FontColorScript>0xFFFFAA</FontColorScript> 
                        <FontHeight>16</FontHeight>
                        <Tabs>0L,5L,272R,345R</Tabs>
                              <GaugeString>\t%Ac %((C:ITrafficInfo:S:ATC MODEL, string))%!s!                                                 
                                \n\n\t%Gs %((L:Target_Groundspeed, number) 10 / near 10 *)%!4d!%kt%
                                \t\t%Alt %((L:Target_Altitude, number) 100 / near)%!4d!\{dpl=FL}
                                \n\n\t%Hdg%((C:ITrafficInfo:S:PLANE HEADING DEGREES MAGNETIC, degrees))%!4d!%\{dplo= }
                                \t\t%\{clr=@AiFontColor}%Dst %((L:Target_Distance, number) 1.59 &lt;)%{if}%((L:Target_Distance, number) 6076 *)%!4d!%ft%((L:Target_Distance, number) 1.6 &gt;)%{else}%((L:Target_Distance, number))%!4.1f!\{dpl=nm}%{end}%
                                \n\n\t%\{clr}%VSI: %((L:Target_VSI, feet per minute) abs flr )%!d!%  %((L:Target_VSI, feet per minute) 0 &lt; if{ 'Dn' } els{ 'Up' } )%!s!
                                \t\t%\{clr=@AiFontColor}%(-299 299 (L:Target_Altitude, number) (A:Indicated Altitude,feet) - rng)
                                      %{if}
                                    %((L:Target_Altitude, number) (A:Indicated Altitude,feet) - abs)%!3d!%'%
                                      %{end}
                                    %((L:Target_Altitude, number) (A:Indicated Altitude,feet) - 100 / abs 3 &gt;)
                                      %{if}
                                    %((L:Target_Altitude, number) (A:Indicated Altitude,feet) - 100 / near abs flr)%!3d!%
                                      %{end} 
                                    %((L:Target_Altitude, number) (A:Indicated Altitude,feet) - 0 &lt; if{ 'blw' } els{ 'abv' } )%!s!
                                \n\n\t%Brg %(@ClosingSpeed (&gt;L:ClosingSpeed,number))%(@AspectAngle (&gt;L:AspectAngle,number))
                                %((L:Target_Bearing, number) abs flr )%!3d!\{dplo= }%  %((L:Target_Bearing, number) 0 &lt; if{ 'L' } els{ 'R' } )%!s!
                                \t\t%Cls %((L:ClosingSpeed,number))%!4d!
                        %</GaugeString>
                        <Length>350</Length>   
                        <Size>350,200</Size>
                        <Bright>True</Bright>
                    </GaugeText>
                </Element>
and ,

Code:
                <Element id="TGT_Data_Calc">
                        <FloatPosition>0.000,25.000</FloatPosition>
                        <GaugeText id="GaugeText">
                            <Bright>True</Bright>
                            <FontColor>0x93FF72</FontColor>
                            <FontFace>Gloucester MT Extra Condensed</FontFace>
                            <FontHeight>16</FontHeight>
                            <GaugeString>%((L:Filter) (&gt;C:ITrafficInfo:Filter))
                                %((L:ListFirstVis) 16 + (C:ITrafficInfo:ListSize) min s2)
                                %{if}%((L:ListFirstVis) sp1)
                                    %{loop}%(l1 (&gt;C:ITrafficInfo:CurrentVehicle))
                                    %((C:ITrafficInfo:SelectedVehicle) l1 == )
                                    %{if}\{rev}\{blc=@FontColor}%{end}
                                    %((A:PLANE LATITUDE, radians) rddg dnor (&gt;C:fs9gps:GeoCalcLatitude1,degrees)
                                    (C:ITrafficInfo:S:PLANE LATITUDE, radians) rddg dnor (&gt;C:fs9gps:GeoCalcLatitude2,degrees)
                                    (A:PLANE LONGITUDE, radians) rddg dnor (&gt;C:fs9gps:GeoCalcLongitude1,degrees)
                                    (C:ITrafficInfo:S:PLANE LONGITUDE, radians) rddg dnor (&gt;C:fs9gps:GeoCalcLongitude2,degrees)
                                    (C:fs9gps:GeoCalcBearing,degrees) (&gt;L:sAI_Bearing, degrees)
                                    (L:sAI_Bearing, degrees) (A:Plane heading degrees true, degrees) - 360 % dnor s0
                                        180 &gt;
                                        if{ 360 l0 - /-/ } els{ l0 } (&gt;L:Target_Bearing, number)
                                    (C:fs9gps:GeoCalcDistance,nmiles) (&gt;L:Target_Distance, number))

                                    %((C:ITrafficInfo:S:GROUND VELOCITY, knots) (&gt;L:Target_Groundspeed, number))%

                                    %((C:ITrafficInfo:S:PLANE ALTITUDE, feet) (&gt;L:Target_Altitude, number))%
                                  
                                    %((C:ITrafficInfo:S:Vertical speed,feet per minute) (&gt;L:Target_VSI, feet per minute))

                                    %((C:ITrafficInfo:S:PLANE HEADING DEGREES TRUE, radians) rddg (&gt;L:Target_Heading, number))%

                                    \{nr}
                                    %(l1 ++ s1 l6 &lt; d)
                                    %{if}\n\{lsp=16}%{end}
                                    %{next}
                                %{end}%
                            </GaugeString>
                            <Size>4,2</Size>
                            <Transparent>True</Transparent>
                        </GaugeText>
                </Element>
The alternate colour is previously declared in a Macro .
Code:
        <Macro id="AiFontColor" Name="AiFontColor">
            <MacroValue>0xFFFFFF</MacroValue> 
        </Macro>
Note also that other Escapes are included within the Loop script .

Cheers
Karol

EDIT Shot shows readout text on Radar at right , data relates to aircraft at left .
capture_05042014_224518.jpg
 
Last edited:
Top