How to create a panel light with switches on top

Help and techniques for creating Air Manager Instrument Graphics

Moderators: russ, Ralph

Post Reply
Message
Author
freedom
Posts: 63
Joined: Wed Jul 29, 2020 2:41 pm

How to create a panel light with switches on top

#1 Post by freedom »

I have been trying to create a night panel using a black mask for dimming and light mask for lighted texts but in vane. The layers are as follows:

Light texture
----------------
Black mask
----------------
Switches graphics
----------------
Panel graphics

How would you make it work properly so that when the panel is dimmed, all the switches are dimmed as well but the light texture will not mask the switches (which move depending on positions)

Help is deeply appreciated thanks!

Freedom

astroseus
Posts: 46
Joined: Sun Jul 18, 2021 9:02 am
Location: Belgium

Re: How to create a panel light with switches on top

#2 Post by astroseus »

Hi,

I would like to offer my assistance if it's purely graphics that you're struggling with.
The coding part, I'm struggling with myself unfortunately.
However, I fail to understand what the problem is you're having.
Can you explain a little bit with images what you're trying to do and where the blocker is.

Thanks
P.

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: How to create a panel light with switches on top

#3 Post by JackZ »

Hi

The easiest way is to create "holes" in your light and black masks where you want the underlying masks to show thru. This using boolean operations in Skinman.
Could you post here the 4 masks png resources?

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

freedom
Posts: 63
Joined: Wed Jul 29, 2020 2:41 pm

Re: How to create a panel light with switches on top

#4 Post by freedom »

Thx, here are my graphics, not sure if there is a better way to do it though.

I have a basic panel
panel.png
A backlight texture
panel_bl.png
I have a 3 pos switch
ldg_sw_down.png
ldg_sw_down.png (11.2 KiB) Viewed 2889 times
ldg_sw_mid.png
ldg_sw_mid.png (11 KiB) Viewed 2889 times
ldg_sw_up.png
ldg_sw_up.png (11.4 KiB) Viewed 2889 times
Plus a 1x1 black pixel as a dimming mask

How would you mask the switches? Do you need 3 individual masks?

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: How to create a panel light with switches on top

#5 Post by JackZ »

Hi

The problem is in the 1x1 dimming mask.
It should instead be a full sized black mask with « holes » in it at the switches locations so this part is not dimmed.
And switches graphics should be located on the very top layer, (in reality, declared further down in the Lua code) since the switches are not lighted nor affected by the black mask itself
The switches should contain the graphics of the lever only, not the casing which is normally dimmed as well and should be in the main panel..

As per the switches, I think the shadow should be mirrored vertically, as the shadow being ABOVE the switches make them weird
Last edited by JackZ on Sun Feb 20, 2022 12:31 pm, edited 1 time in total.
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: How to create a panel light with switches on top

#6 Post by JackZ »

There you go.
In your sample, the lighted text are not exactly flush with the panel text.
image.png
use this mask and play with the opacity() function to achieve the desired result
black_mask.png
black_mask.png (3.41 KiB) Viewed 2780 times
If you want more sophisticated effects, you'll have to create three separate images of the switch which have been darkened, and add a second set of switch as an overlay, with no action.
, like this one:
image.png
image.png (17.09 KiB) Viewed 2778 times
which yields the following result:
image.png
Then move both switches (the day and the night version) simultaneously using switch_set_position() in the callback function of the switch.
Then play with the opacity() function for the darkened switch according to the current lighting condition
image.png
Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

Post Reply