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

May 16, 2012 at 2:47am

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

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?

– Pasted Max Patch, click to expand. –
#63623
May 16, 2012 at 6:11pm

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!!)

#229338
May 17, 2012 at 10:35am

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 ? :/

#229339
May 17, 2012 at 6:54pm

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

#229340
May 18, 2012 at 12:27am

@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.

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.

– Pasted Max Patch, click to expand. –
#229341
May 18, 2012 at 4:30am

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

#229342
Nov 5, 2013 at 7:05am

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.

#270199

You must be logged in to reply to this topic.