Home › Forums › Development › Other stuff › Using Layers Tutorial 1.0 › Reply To: Using Layers Tutorial 1.0
Hi Spiffo,
That’s right – a layer covers the whole panel, but if a component is not covered by another object in a layer above it, it can be accessed, so with a bit of design, so it’s actually a very useful feature.
Also, in those if else statements, that last else
is not necessary.
function switch_tab_contents()
mod1 = panel:getModulatorByName(“modulator-2”):getModulatorValue()
if mod1 == 0 then
panel:getCanvas():getLayerByName(“Layer3”):setVisible(true)
panel:getCanvas():getLayerByName(“Layer4”):setVisible(false)
elseif mod1 == 1 then
panel:getCanvas():getLayerByName(“Layer3”):setVisible(false)
panel:getCanvas():getLayerByName(“Layer4”):setVisible(true)
else end
end — function