Flash as3掩码大小
塞纳里奥 我有一个影片剪辑('myMask'),里面有 3 层: 1.面具形状(脸部轮廓) 2.(人的)照片 3. alpha 0% 的正方形(比遮罩形状稍大)
1 位于 3 的中心 1 遮盖了 2
图片比 2 和 3 大得多,并且处于旋转角度 + 偏离中心。
问题 设置蒙版后,我需要获取/设置最终影片剪辑“myMask”的四个角的位置。
在 flash IDE 中,它显示的大小与 3 相同,即我需要的正方形,因为最终我试图操纵它的四个角的位置。但在 as3 代码中,.width 和 .height 是与所有元素(包括未屏蔽时的图片 (2))关联的边界框的大小(大得多)。
有没有办法获取AS3中显示的掩码的大小?
谢谢
Senario
I have a movieclip ('myMask') which has 3 layers inside:
1. Mask shape (face silhouette)
2. picture (of person)
3. square shape with alpha 0% (this is slightly bigger than mask shape)
1 is in the center of 3
1 is masking 2
The picture is much bigger than 2 and 3 and is at a rotated angle + positioned off center.
Problem
I need to get/set the position of the four corners of the final movieclip 'myMask' after the mask is set.
In the flash IDE this shows as the same size as 3, the square which is what I need because ultimately I am trying to manipulate the position of its four corners. But in as3 code the .width and .height is the size of the bounding box associated with all elements including the picture (2) when un-masked (much bigger).
Is there a way to get the size of the displayed mask in AS3?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果将遮罩放入另一个影片剪辑中并调用该 maskHolder 并使用 maskHolder 作为遮罩,您将能够访问宽度和高度属性,如下所示:
George
If you put the mask into another movieclip and call that maskHolder and use maskHolder as the mask instead you will be able to access the the width and height properties like this:
George