[Laszlo-dev] implementing non-rectangular masks in LZX
P T Withington
ptw at openlaszlo.org
Sat Jun 10 08:57:38 EDT 2006
Is Sarah's suggestion for an LZX syntax, a tag parameter `mask`,
referring to another view), the way we want to specify this? Whether
the mask view is specified by a resource or drawn would then be
independent, no? And how does this map down to the Sprite API?
Let's have a proposal http://wiki.openlaszlo.org/Enhancement_Proposals.
On 2006-06-10, at 01:11 EDT, Max Carlson wrote:
> Sarah Allen wrote:
>> I did a little looking into how this is done in Flash (swf7,
>> masks). If you are intested, there's a nice tutorial here:
>> scriptable_masks.htm . The
>> cliff notes are:
>> After playing with it a bit, I think I want a mask to be another
>> so I can resize and position it. Ideally something like:
>> <view resource="myimage_rsc" mask="anotherview"/>
>> I created a little test with the ActionScript inlined just to get the
>> hang of things. This works fine:
>> <view id="myview" resource="photo.jpg">
>> <method name="setMask" args="v">
>> Debug.write('setMask', v, v.__LZmovieClipRef);
>> <view id="mymask" oninit="myview.setMask(this)"
>> x="130" y="-20" width="200" height="200" stretches="both"/>
>> However, when I make the mask clickable (simply setting
>> will do it), the mask disappears when my mouse goes out of the mask's
>> bounds and reappears when the mouse goes back in. I didn't see
>> magic in LzView's setClickable.
>> Can anyone else give me a clue as to why this would happen?
>> p.s. I've been testing in lps-3.3. As soon as I sync trunk, I'll
>> into a test directory if anyone else wants to see it in action.
> You should be able to do this with a drawview by programatically
> drawing and calling the undocumented method clip() in place of where
> you'd normally do a fill(). It's untested territory, so it'd be great
> to get it worked on. See the clip() method in
> for more, and let me know how I can help!
> Max Carlson
> Laszlo-dev mailing list
> Laszlo-dev at openlaszlo.org
More information about the Laszlo-dev