0

I have a drag-and-drop game and I'm having some trouble with the alignment of the pieces once they get dropped onto their zone. There are 12 MCs, and there are 4 columns x 3 rows of targets that are perfectly aligned. When all of movieclips are dropped, the horizontal/vertical alignment isn't perfectly even with one-another.

I know this deals with the registration point on each mc, and I'm trying to center each piece's point as much as possible using FreeTransform, but it's all visual and leaves room for error.

Is there a way to align all 12 of these pieces once they are dropped onto their target?

4

1 回答 1

1

我不确定我是否完全理解你的问题。如果您只是想重新对齐剪辑以确保它完全居中;你不必在视觉上做到这一点。

只需进入剪辑点击 ctrl+a 选择所有内容并查看高度和宽度。剪辑的中心点应位于:

x = -(宽度/2) y = -(高度/2)

所以你可以浏览每个剪辑并手动设置它。


如果您的所有剪辑都具有相同的注册点,则可以在代码中完成类似的代数,以计算它们在居中时应该放置的位置。

听起来那是行不通的,因为您已经手动移动了它们的注册点,在这种情况下,您可能应该直接进入并使用以前的方法手动计算它们的中心。

于 2013-03-15T19:52:05.683 回答