Sign in to follow this  
n4gix

Text Box

Recommended Posts

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

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

>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... ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this