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

Keith Clarke keith.clarke at clarkeandclarke.co.uk
Thu Mar 17 03:46:11 EDT 2011


...thanks Jim & Scott - it's good to know that LiveCode has an integrated way of managing rounded rectangle window shapes. 
Bizarrely, it now looks like I may have to implement this HUD outside of a revlet, so I'll have to use the nine-images trick for Internet Explorer compatibility anyway! ;-)

On 17 Mar 2011, at 01:57, Scott Rossi wrote:

> 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
> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list