Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Text Box

Featured Replies

Hi all,I'm just starting to program gauges in xml, so I have 2 questions:how can i create a text box in a gauge xml programmed ?how to assign the string, wrote in this box, to variables ?Thank you so much in advance!Paolo

  • Commercial Member

Paolo,I just figured this one out a few nights ago myself. I am also just beginning to play with XML so most of this is purely speculation :) . Anyway, here's an example of a simple text box that worked for me:

		  <Element>		   <Position X="25" Y="27"/>			<Text X="21" Y="10" Bright="Yes" Length="4" Font="quartz" Color="Deepskyblue" Adjust="center" VerticalAdjust="center" Multiline="No">			   <Axis X="0" Y="0"/>			   <String>LEFT</String>			</Text>		  </Element>

This simply puts the word "Left" on my fuel qty gauge. The LEFT can also be replaced with something like:

<String>%((A:Fuel tank left main quantity, gallons) (A:Fuel weight per gallon, pounds per gallon) 1 / * )%!5.0f!</String>

In which case the text string will display the left tank's fuel capacity in pounds.""appears to be the coordinates of the text box in relation to the upper left corner of any background image you may be using. If using no background image, leave it out.""Formats the textbox. "X" is the width, "Y" the height. It appears that the height you specify under "Y" also determines the font size, although I think I saw an example somewhere where the font size was specified elsewhere. I can't remember the exact attribute. I have no idea what "Bright="Yes" does, but I believe it has to do with whether the panel lights illuminate your text or not. Maybe someone else could "shed some light on this" ;) ."Length"apparently is the number of characters your textbox will hold. The "Z" attribute must be wide enough for all characters to fit within the box"!5.0f!"Has to do with the position of the decimal point such as in the fuel quantity example above. The decimal is all the way to the right in this case, and doesn't appear at all on the gauge. "!5.0f!" - 5 places to the left of the decimal and 0 places to the right.That's about the extent of my knowledge on this. I hope it helped you out some :) .Jim

Thank tou very mutch Jim!This is the exact answer. Your example will help me to proram my gauge.CiaoPaolo

  • Author
  • Moderator

>Hi all,>>I'm just starting to program gauges in xml, so I have 2>questions:>>how can i create a text box in a gauge xml programmed ?>>how to assign the string, wrote in this box, to variables ?Doug Dawson and I have expanded on my original "Blackbox" gauge to include up to 20 XML L:variables on the display, but I haven't gotten around to writing the "manual" for it, much less uploading it anywhere... ;)

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.