当物体移动时检测 Flex 4 中的控件重叠?
我有这个小项目这里。现在它除了让角色移动之外几乎没有任何作用。
我使用
如果我的问题有点缺乏信息,请在此处发表评论,我将根据您的需要更新更多详细信息。
请并谢谢您!
I have this small project HERE. Right now it barely does anything but make the character move.
I move the character by using <s:Move>. Now as you can see on the link to my project page, it moves to where you point the mouse and click. I want to be able to stop the character from moving if it hits another object or in this case, the "tree". Is there a script in AS3 that will let me detect collisions or controls that are overlapping each other?
If my question is a bit lacking information, please comment back here and I'll update it with more details as you need.
Please and thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所有 DisplayObject 都有一个名为 hitTestObject(obj:DisplayObject) 用于测试一个对象何时与另一个对象重叠。您可以在 Tree 类、DisplayObject 类,或任何扩展 DisplayObject 的类。
All DisplayObjects have a a method called hitTestObject(obj:DisplayObject) that tests when one object overlaps another. You can read about it in the Tree class, DisplayObject class, or any class that extends DisplayObject.