Howto:Make a clickable panel

From FlightGear wiki
Jump to navigation Jump to search

There are two methodes to make a clickable planel in FlightGear at the moment:

  • Hotspot: adds a clickable (invisible) face at a certain position.
  • Pick: makes a whole object clickable.

The easiest to use is pick, since you do not have to look up all the coordinates. Also the pick animation is more realistic and therefore more often used.


The hotspot animation is somewhat complicated. You have to define the x and y coordinates of every clickable "face" (hotspot) aswell the width and heigth of the hotspot to click on. See the following example of the 777-200.

Panel file

Make a new panel file (.xml) in your aircraft's directory. The following lines are only placed on top of the file:

 <name>777-200 Overhead Panel</name>
   <name>panel hotspots</name>

Now all hotspots need to be listed as seperate actions:

     <name>Master Battery Switch</name>

We close the file with:


Model file

Now we need to link to this file from our model's file. Add something similar to the following in your model file:



As of FlightGear 2.11 (Git version), there's a new Knob / slider animation, to be used instead of the pick animation.

For 3D clickable object we can use the pick-animation. It makes a whole (3D) object clickable. This is especially easy to use with switches.

Each single clickable object requires a seperate animation; however you can have multiple objects (that result in the same action) in one animation. A pick animation exists of atleast the following lines of code, to be added in the .xml file of your panel:

  • object-name: remember to change into your buttons/knobs/switches name (!) and set the property to the property, corresponding with your button.
  • button: what mouse button result in this action:
    • 0 = left mouse button
    • 1 = middle mouse button (usually clicking the scrollwheel)
    • 2 = right mouse button
    • 3 = mouse wheel forward
    • 4 = mouse wheel back
  • repeatable: setting to true will make users able to hold their mouse on a knob or switch, repeating the action. This should be disabled for most (if not all) toggle switches. Only dials usually benefit from such repeatability.
  • interval-sec: is optional. Can be used on repeatable dials, to limit the frequency of actions.
  • binding: is optional. Can be used to trigger an action on pressing the specified button.
  • mod-up/binding: is optional. Can be used to trigger an action on releasing the button pressed over the object before.

Although binding and mod-up/binding are both optional, at least one should be included in order to make the object clickable. A list of all available bindings can be retrieved at the bindings article.

Note that you can add multiple actions in a single animation.


To check if the pick and/or hotspot animation work (on the correct buttons) we launch FlightGear and press Ctrl+C. Now all clickable objects or areas will get a yellow lining.

Related content