Change panel transparency?
-
Is there a way to change the opacity of a panel, including all of it's children? I’m looking for a way to make something semi-transparent on button press.
Thank you!
-
@tomekslesicki something like...
g.setColour(Colours.withAlpha(Colours.Black, 0.2))
...in the paint routine would make it black @ 20% opacity
I've never used child panels but I assume it's a similar process
-
No, there's no inbuilt function for setting the opacity of a component, but depending on how your interface looks you can overlay a panel with a semitransparent colour (works only if you're using a uncolored background though
-
Are all the children also panels? If not then you'd need to style them with LAF.
-
@Christoph-Hart I could do this, thanks! I'd just need to figure out how to get blending modes to work because I'm using some textures. However, changing the blending mode makes an image disappear so either it's not working at the moment (?) or I just don't get something super obvious.
-
@tomekslesicki this is for the scripting part :
HiseSnippet 1049.3ocsV0kaaaDDdoroSjZSPSQN.D5IZ.UAolzj.DDDW8WfZ7ODVNF8oZrhbozBsbWBtKishgeKOlG5QnmfdE5EnWhdC5Mnc1cojnZUbREP0CBb1Y9l4aFNyrLHSDRjRQFxo5YySIHmuzczbtZZ2oXJGMrGx49tGgkJRlm8nNySwRIIB43ryqzG3TcWj42e9xNXFlGRVcDBctfFRNjlPUqNM3fWSYrA3HxYzjRV+3CFFJ3cELQNvmcbagRwgyvSHGi0lUwE4rW+HpRjMRgUDIxY2Nhn4ilJtjas+bpjNlQzBsQi.GYOdffEoYr9TT2oTVTvh7Vh.uDrpJrisJ7P2inQzkmupZ7UFEdqPTtd3TYc5syZzq8GidafRNknztVJ8.2QgYzT0JMZ97EtC4vKmXLT1KSEqsnJ+bE2tBvBtpYBdFYPFHrDg+SZ0pgG729OuVMnzKUduEm48ZtXbauW3s.3DhpqHIUvAA+5Fs0ADq.Df4D1GGgUsFRM6iMYBbzvD3Mqe8qCN8jene2ytXvIG1q+o2DvYFMMS4Sp2vq9B4xvkDU.7BQcpHWQ4D+3bdnhJ39S1u100pNo4XxDJuCiviNDOmj4W+XQVBlA9yvdM+NGyxI96CdErOJCeYAeVFuFdpoTo1zCEgXVGQNOR52Z+FdPMqkE2DbtTRwPnxy7ej8rkAEDuQS5ZTNCXo2BV5I3FVnKVYBle3hJUCnXBjxjCEYZFIUmnFe87ZVxK0EWCztXFaLLh3utG0AsTvNVnHmv8Mts1M079mphi2ntBmwzYxFTqGcytMf977jwjrxIk1Pned8gj897FRBssVkLTvGxopSRIEx29TNpn2TObUvPvTkYz59EiViXzHRFhBN4NtlJJxP9x63PuYXOrBuvMfGgnjRxTTcx3zi7VXgmchspaOhblRjB6tVNN.aX+jA8JjiqyuCgat9gO.OHUy0kj8LFfRnQQLRfPR0k7Rr62fE0oinuyv3qe3u9p+3cu+kIkWRiPI3qJmOx73X5UlsqwTVhTAbxL.fb9Z22HIdQjXbNS4ImA9AZjmQhNSXrGUJo1ylT2awRJc6qImtqqsUFUJp+zAyWIvO3RZjZpNS+EPbJgNYpZQdi926AgMvhnbFVs9ZY8cQEJz0jx6B0663PsZd479+vt5V25t5OWJ9.2.pJb5l4XkMvQnE6+CNVbC28b6GGSBUqH3ttC9ws85rOQ3sKpmbDF5tzM2GmmLBtjOj.QmCcGR866J5gTqbKsrtBLB1lZD9K3Wgx1ZYmBksWnD5qCyDWDZGs02gdWyI.m3lOenJ7cLfr2xYZW2VMaomknWDFpS+uoMBsYLe6Vf4QaAlGuEX9ts.yS1BLOcKv7raEi9Ko99bkHwNN.GDz2ra0woOGCcVltPzeCj60r+O
Regarding how the different blend modes works, just look it up online :)
-
Why do you need blending layers? Just paint the background image with a low alpha value over the panel
-
@Matt_SF Thank you! I'm familiar with blending modes but that little snipped helped me to get this to work in Hise :-)