I have created overhead instruments for the MSFS PMDG 737 and want to show them when I press a (AM instrument) button on my touch screen. So on the Airmanager Home tab I arranged all instruments I allways want to see for flying. Then I thought I could make a second panel on the Home tab with just the overhead instruments. In a panel script I want to be able to show the overhead instruments with the press of a button.
The only solution I found is to make one panel in the Home tab with all overhead insruments already arrange on top of the other instruments. That is very uncomfortable to do, for example if I want to change instruments below the overhead instruments. My script is:
Code: Select all
WIDTH = 1920
HEIGHT = 1080
local gGroupOverhead = group_add()
-- local gGroupBase = group_add()
local gFrame = canvas_add(0, 0, WIDTH, HEIGHT, function()
_rect(0, 0, WIDTH, HEIGHT)
_fill("gray")
end)
z_order(gFrame, 1000)
function AddInstrument(group, name, uuid, offset)
group_obj_add(group, instrument_get(uuid, offset))
end
-- ================ instruments from overhead panel ====================
AddInstrument(gGroupOverhead, "Overhead Background", "80cd9ce8-3f03-49d9-137f-c5e39ad32f98")
AddInstrument(gGroupOverhead, "Flight Control", "2fa3c344-3e29-444d-8966-a146d3147619")
AddInstrument(gGroupOverhead, "Fuel Pump Switches", "5f3fdf98-cf3f-47de-b7b5-9b4e13175dc9")
AddInstrument(gGroupOverhead, "Standby Power", "518ebdb0-4a93-4477-01bd-514db3230904")
AddInstrument(gGroupOverhead, "Generator Switches", "3172aa53-47b5-415e-3366-878815a98a49")
AddInstrument(gGroupOverhead, "Pitot and Window Heat", "62f80aa5-b789-4ac3-3963-44fbce630aaf")
AddInstrument(gGroupOverhead, "Anti-Ice", "429f27b5-848e-4e9d-b27b-5d77ffa9a720")
AddInstrument(gGroupOverhead, "Hydraulics Switches", "fe61bfa7-21f8-4b7e-a4d3-045a198707cf")
AddInstrument(gGroupOverhead, "Doors", "283b8204-1550-4770-313b-9591e7ce92b7")
AddInstrument(gGroupOverhead, "Bleed", "94fa5175-840e-47c1-2c74-651487865d74")
AddInstrument(gGroupOverhead, "APU EGT", "15f05f56-760f-4068-af56-c3a0fd64fae8")
AddInstrument(gGroupOverhead, "ENGINE START", "11ae414a-51a7-4bdb-a0e6-bd54124ee5af")
z_order(gGroupOverhead, 99)
-- z_order(gGroupBase, 0)
visible(gFrame, false)
visible(gGroupOverhead, false)
-- visible(gGroupBase, true)
button_add("select-frame.png", nil, 1800, 1000, 60, 40, function() visible(gFrame, true); visible(gGroupOverhead, true) end, nil)
button_add("select-frame.png", nil, 1860, 1000, 60, 40, function() visible(gGroupOverhead, false); visible(gFrame, false) end, nil)
I also tried to position all overhead instruments using a panel script. That did work but using viewport_rect on a group of instruments did not work correctly. So I forgot that.
(BTW: I did no see that using z_order had any effect.)
Thank you
Detlef