gpt4 book ai didi

flash - AS3 : Make sure children stays inside parent movieclip's shape

转载 作者:行者123 更新时间:2023-12-05 01:13:09 25 4
gpt4 key购买 nike

红色父动画片段内的形状,
黄色父级影片剪辑中的子级

Image http://frontenddev.com/images/stack.png

我想为黄点设置动画,但要确保它们永远不会超出红色形状的边界。我该如何解决这个问题?

最佳答案

试试hitTestObject .它评估显示对象以查看它是否与 obj 显示对象重叠或相交。

for each(var yellow:DisplayObject in yelloDotsArray)
{
if(yellow.hitTestObject(theRed))
trace("this dot is within the limits");
else
trace("this dot is outside the red area");
}

关于flash - AS3 : Make sure children stays inside parent movieclip's shape,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2465888/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com