Vector window shapes and the great mystery of ink effects

Scott Rossi scott at tactilemedia.com
Wed Feb 25 22:13:19 CST 2009


Recently, Richard Gaskin wrote:

> So I'm looking at OS X's increasingly popular transparent panels as
> described in:
> <http://developer.apple.com/documentation/UserExperience/Conceptual/AppleHIGui
> delines/XHIGWindows/chapter_18_section_6.html#//apple_ref/doc/uid/20000961-TPX
> REF17>
> 
> And I'm thinking, man, I would love to have rounded corners on resizable
> palettes.
> 
> Then it hits me:  could there be some way to layer graphics with
> different blendLevels and different ink effects so that I could define
> the visible window region with one graphic and have everything outside
> of it transparent with another graphic?
> 
> So I started to play with various combinations, and the multiplicity of
> possible options made my head explode.
> 
> Anyone know a way to do this?
> Am I dreaming?

Resizable = yes.  Dynamically resizable = kind of, but practically this will
depend on your situation.

If you have set sizes/states for a palette (or any window) that you can
standardize on, then you can either 1) set the size of your stack to any
number of stored bitmaps that act as masks for the various window sizes you
need, or 2) dynamically create the mask image on the fly using stored bitmap
"pieces" (rounded corners, sides, etc).  Both options are reliable in my
experience, and work fast, with the limitation being that the stack must
"jump" to the new size.

The difficulty comes when you want to allow a user to dynamically resize a
window: this means that as the user drags across their screen, you must
dynamically create the mask used to render the window, assign the
windowshape, adjust the mask art, generate a new mask, and reset the
windowshape, etc.  While this is possible, I assume you would also want to
reposition/resize controls, which will impact the speed at which the masks
can be created.  Obviously this is a very brute force way to generate a
"scalable" window.

Setting the windowshape to the IDs of different mask images has become
pretty fast (at least on OS X if not so much on Windows) but I think you
will be hard pressed to do it dynamically.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design





More information about the use-livecode mailing list