Fi gauge prop subscribe

From Sim Innovations Wiki
Jump to navigation Jump to search

Description

fi_gauge_prop_subscribe(fi_gauge_id, prop_name, callback_function)

fi_gauge_prop_subscribe is used to subscribe to a Flight Illusion gauge property.

See Flight Illusion Gauges for available properties.

Return value

This function won't return any value.

Arguments

# Argument Type Description
1 fi_gauge_id String Reference to the flight illusion gauge.
2 prop_name String Name of the property. See Flight Illusion Gauges for available properties.
3 callback_function Function The function to call when the property value is changed.

Example

-- Get a reference to the gauge
fi_gauge_id = fi_gauge_add(111, "ANALOGUE_ALTIMETER")

-- Subscribe to the AIR_PRESSURE property
fi_gauge_prop_subscribe(fi_gauge_id, "AIR_PRESSURE", function(value)
    print("air pressure = " .. value)
end)