Best practice for creating a resizable HUD-style widget stack background?

Scott Rossi scott at tactilemedia.com
Wed Mar 16 21:57:29 EDT 2011


Recently, Jim Lambert wrote:

> You can also generate a rounded appearance with just one object.
> 
> 1 - create a rounded rectangle graphic with the corner radii you want, say 30.
> 2 - name it "myMask"
> 3 - make it opaque & invisible
> 4 - set its rect to the card's rect
> 5 - set its geometry to scale with the window
> 6 - put this script in the card:
> 
> command maskMe
>    import snapshot from grc "myMask"
>    set the windowshape of this stack to the id of last image
>    delete last image
> end maskMe

[forehead smack]

Jim's right, I should have mentioned this is the easy way to do a round rect
window.  I'm used to the pre-graphic effects days of LC (Rev) where the only
way to create a shadow for a custom window was to create a mask shape in an
image-editing app along with its dropshadow and slice that into 9 tiles.

Now one can simply add a dropshadow to a round rect graphic, place the
graphic in a group with a suitably large margin, and import the windowshape
mask image as a snapshot of the group.

Good call Jim.

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design






More information about the use-livecode mailing list