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.

First Gauge Ever

Featured Replies

I'd really like to learn how to make gauges, but I have no idea. So I decided I'd start out with something that looks kind of simple, but also is something I need.http://fp.images.autos.msn.com/Media/220x1...0284316D172.jpgALL of it is pretty much a button, rather than having some specific section, so I assume this will make it easier (correct me if I'm wrong). It's not a two position switch, only the light on the top changes.I'm good at graphic design, so I can "create" this gauge, but I can't make it functional.I really have no idea at all how to code a gauge like this though, just a lot of ambition. I've tried looking arround for up-to-date tutorials for coding gauges for FSX/FS9 (I can't see compatibility being an issue with this simple a gauge with no numeric readout or dynamic principles), but I can't find any.If anybody could either link me to a good coding gauges tutorial that would be appropriate for my lack of skill and also this simple gauges, or if none such thing exists offer a bit of personal experience to help me out, that would be really appreciated!

  • Moderator

Since it's a static image (the button) with only a "lit LED" displaying when the button is pressed, an XML scripted "gauge" is by far the simplest approach:

<Gauge Name="Engine Start" Version="1.0">  <Image Name="StartButton_bgnd.bmp"/>  <Element>	<Position X="0" Y="0"/>	<Select>	  <Value>		(L:StartButton,number) 1 ==		if{ 1 } els{ 0 }	  </Value>	  <Case Value="1">		<Image Name="LED_ON.bmp" Bright="Yes"/>	  </Case>	</Select>  </Element>  <Mouse>	<Cursor Type="Hand"/>	<Click Kind="LeftSingle+LeftRelease">	  (M:Event) 'LeftSingle' scmp 0 == if{ 1 (>L:StartButton, enum) }	  (M:Event) 'LeftRelease' scmp 0 == if{ 0 (>L:StartButton, enum) }	</Click>  </Mouse></Gauge>

You only need two images, the static background of the button, and a "lighted LED."When you left-click on the button, the LED will "light up." When you release the button, the "lighted LED" is hidden.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author

Thanks for your response!I'd like to start with XML for the moment.

A slightly more comoplicate XML altimeter

<!-- Altimeter for Hawker Fury --><Gauge Name="alt_altimeter" Version="1.0">  <Image Name="alt_altimeter_background.bmp"/>  <Element>  <Image Name="alt_altimeter_face.bmp" Luminous="1"/>  </Element></P> <P>  <Element>	<Position X="74" Y="74"/>	<Image Name="alt_altimeter_needle.bmp" PointsTo="North" Luminous="1">	  <Axis X="4" Y="40"/>	</Image>	<Rotate>	  <Value Minimum="0" Maximum="35">(A:Indicated Altitude,feet) 1000 /</Value>	  <Failures>		<GAUGE_ALTIMETER Action="Freeze"/>		<SYSTEM_PITOT_STATIC Action="Freeze"/>	  </Failures>	  <Nonlinearity>		<Item Value="35" X="114" Y="74"/>		<Item Value="30" X="74" Y="114"/>		<Item Value="25" X="34" Y="74"/>		<Item Value="20" X="74" Y="34"/>		<Item Value="15" X="114" Y="74"/>		<Item Value="10" X="74" Y="114"/>		<Item Value="5" X="34" Y="74"/>		<Item Value="0" X="74" Y="34"/>	  </Nonlinearity>	  <Delay DegreesPerSecond="360"/>	</Rotate>  </Element>    <Mouse>	<Help ID="HELPID_GAUGE_ALTIMETER"/>	<Tooltip>Altitude (%((A:Indicated Altitude,feet))%!d! ft)</Tooltip>   </Mouse></Gauge>

It has three bit maps: for the altimeter face and another for the needle, both of which are luminous and a third for the gauge bevel which isn't illuminated. Unfortunately, it's not possible to upload .bmp filesd so I've uploaded them as .jpg.

Gerry Howard

  • Author

Sorry when I first posted I missed the two responses with code.To both of you, THANK YOU SO MUCH! This has really been helpful for me seeing this, and I feel much more confident approaching gauge design now.Thanks very much for this great start! I'm really pleased to see how helpful people are at AVSIM.

Sorry when I first posted I missed the two responses with code.To both of you, THANK YOU SO MUCH! This has really been helpful for me seeing this, and I feel much more confident approaching gauge design now.Thanks very much for this great start! I'm really pleased to see how helpful people are at AVSIM.
Hey, here is a link to one of the best resource sites for learning xml.http://www.fs2x.com/Tutorials.htmYou have gotten responses from the top guys in guage programming, I'm not in that league but learned heaps from them. The search here turns up goodie after goodie, welcome to gauges 101...Douglas

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.