can I set bgcolor in a patch and have control over transparency?

sisko445's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I thought the alpha inlet would do the trick, but I can't get it to work. In the attached patch, can someone advise how I can fade the color in and out from its usual white?

seejayjames's icon

didn't see the patch, but for alpha in a patch background, you have to make it without title bars (I think it's an OS limitation, not a Max one).

message:
window flags notitle, window exec
to
[thispatcher]
(see thispatcher help file for more goodies)

you can use the new "dragging" function of [panel] to move the window around, because you can't do it normally without the title bar. (BTW thanks again C74 for adding that to [panel]---awesome!!)

vichug's icon

owww dragging is so awesome ! thanks Seejayjames !! renders some complicated, dirty patching i remember having seen completely useless. it's not even in the helpfile.... how many undocumented magical new features like this ? :/

sisko445's icon

yes, very cool tip on dragging panels.. never would have seen it. Thanks!

I removed the title bar from my patch, but I still couldn't get alpha to work on bgcolor. I tried sending float values between 0 and 1 to the alpha inlet and nothing happens. =( I'm using OS X, Max 6

seejayjames's icon

@vichug: don't thank me, thank C74! :) I saw it on the forums as well, or would probably not have seen it either. yep I also made a "draggable-patch" workaround at one point, it was a bit messy too, heh (mousestate and some window-size bits...) but it did work. So glad to see it implemented as a function in an object, so it takes care of it under the hood, excellent.

Might be nice to have that in jit.window without a title bar too...? I made a similar workaround for that as well, but it wasn't very smooth. Included in the object I imagine it would be better.

Max Patch
Copy patch and select New From Clipboard in Max.

Here's a patch that works for me on OSX, Max 6...blue panel to drag, slightly different blue background that can fade, when you get rid of the title bar. I think you need to specify the R G B values too, not just the alpha, for [bgcolor] to work. I used a [pak] with a blue, modify to suit. you can easily send the bgcolor to the panel too, if you want everything to go transparent.

sisko445's icon

seejayjames, you da man! Definitely makes sense now. Thanks!

admant's icon

strange behavior anyway, if you fade between 0. and 1. the bgcolor flickers. A way round is to just leave the background transparent and fade a panel instead.

seejayjames's icon

A couple additions to the transparent patch. Yes I have resurrected an ages-old thread, sorry ;)

Max Patch
Copy patch and select New From Clipboard in Max.