Text Strings

I'm making a gauge that shows as much info as possible about engine parameters for small GA aircraft. I got inspiration from TK Elektronics.

This is my progress after about an hour:



As you can see it works for the most part but i'm not happy with a few things. Here's some code:

Code:
<!--==== OAT ====-->
<Element>
	<Position X="184" Y="110"/>
	<Text Bright="Yes" X="85" Y="30" FontSize="20" Length="5" Fixed="Yes" Font="Arial" Color="#2b2b2b" Adjust="Right" VerticalAdjust="Center">
	<String>%((A:AMBIENT TEMPERATURE, celsius))%!3d!&# 176;C</String>
	</Text>
</Element>
I wish to use the font in bold style, rather than cheating and simply setting the font to Arial Black I wish to use the style string '\{bo}' but i have no idea how to actually put that into practice.

Maybe if I can style it I could also change the string so if EGT or CHT for example were to breech a max temp I could make the number blink... :rolleyes:
 
Last edited:

n4gix

Resource contributor
Very nice! :D

The "escape codes" only work in a <FormattedText> section. If you examine the XML script for the G500 for example, you'll see entries such as this:

Code:
<!-- General purpose macros -->
<Macro Name="BlinkerCode">(@g:menuBlinker) d 0 &gt; if{ -- (&gt;@g:menuBlinker) 15 sp0 1 } els{ l0 -- s0 d 0 &lt;= if{ 30 sp0 } 15 &gt; }</Macro>


                     <Element>
                        <Position X="10" Y="5"/>
                        <FormattedText X="256" Y="180" Font="Arial Black" FontSize="14" LineSpacing="17" Color="0x00FF00" Bright="Yes" Tabs="0,170C,220R">
                           <Font FontSize="12"/>
                           <ScrollY>(@g:listScroll)</ScrollY>
                           <BlinkCode>@BlinkerCode</BlinkCode>
                           <String>
								%((@c:WaypointAirportFrequenciesNumber) s2 0 !=)
								%{if}
									%(0 sp1)
									%{loop}
										%(l1 (&gt;@c:WaypointAirportCurrentFrequency))
										%((@g:listCurrent) l1 == (@g:listItems) 1 == and)%{if}\{blnk}%{end}
										%((@c:WaypointAirportFrequencyName))%!s!\{nr}\t
										%((@c:WaypointAirportFrequencyLimit))%{case}%{:1}\{dpl=RX}%{:2}\{dpl=TX}%{end}\t
										%((@c:WaypointAirportFrequencyValue,Mhz) 100 * near d 100 div)%!03d!.\{fnt1}%(100 %)%!02d!\{fnt}
										\n
										%(l1 ++ s1 l2 &lt;)
									%{next}
								%{end}
							</String>
                        </FormattedText>
                     </Element>
Note that typical usage is to place the desired escape sequence before the "action" and then the opposite escape sequence after the "action."

In the case of /{bo} you would typically use /{md} to restore to "normal" text.

For a complete list of the "Escape Sequences" available for use, see:

http://blogs.technet.com/engauged/archive/2006/12/08/text-in-xml-gauges-part-iii.aspx#comments
 
Last edited:
Top