Text in XML gauges, part III

Text in XML gauges, part III

  • Comments 2
  • Likes

It's been over a year since I mentioned text in XML gauges (an area where we don't do a good job of documentation) and a while since I posted anything truly useful on this blog, so I guess it's about time... 

A coworker and I were looking at some XML script and got onto the topic of our string syntax, which is something that wasn't fully documented in the FSX SDK, unfortunately.  It looks like we omitted any explanation of the escape sequences that can be used in these strings (which have been around since FS 2002).  So, after a 4-year delay, here's a list of examples.  Hopefully an SDK or blog post will go more in-depth in the future.

Escape code example

Translation

\{tabs=50R,60C, 244L}

set 3 tab stops; the first is right-aligned, the second is centered, and last is left-aligned.

\{fnt1}

switch to the first alternate font specified as a child of the gauge text element

\{fnt}

return to the default font

\{up}

uperscript

\{dn}

subscript

\{md}

normal (neither superscript nor subscript)

\{bo}

bold

\{ul}

underline

\{itl}

italic

\{strk}

strikeout

\{blnk}

blink

\{rev}

reverse background/foreground color for text

\{nr}

normal - clear all properties previously set.

\{lcl}

line color

\{blc}

background line color

\{clr}

color

\{bck}

background color

\{strk}

strikeout

\{dplo=X}

put a degrees symbol above the next character after the ‘=’

\{dpl=XY}

make X superscript and Y subscript

\{lsp=23}

set line spacing to 23

\{lsp}

set line spacing to default

\{ladj=L}

set horizontal text alignment to left.  (use ‘C’ for center or ‘R’ for right)

\{line=240}

draw a horizontal line with width 240

\{lmrg=20}

set the left margin to 20

\{rmrg=30}

set the right margin to 30

\{img1}

insert image #1 (a text element can have image children)

 I hope this helps.  Let me know if you think it would be useful to give a more thorough explanation. 

Comments
  • A more thorough explanation sounds just great thanks...

  • just what I've been looking for !

    Thanx.

    One Question:

    I've been customizing a the GPS500 gauge, moving buttons around and adding an extra display area for the indicators like MSG and SUSP. One problem I got is that the \{blnk} on the moved MSG indicator does not 'blink' the text, rather it seems to produce an XOR of the text with one slightly offset from the other - therefore the text doesnt blink, it just becomes a mess of bits, a bit like a corrupted outline font. Any ideas why this is happening ? (note that I did change the size of the text rectangle and the fontsize itself, could that have a bearing - though I don't see why.)

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment