1

我使用此代码使我的影片剪辑指向我的鼠标所在的位置,但它没有正确转动。好像变了一样。像影片剪辑的中心是错误的?任何人都可以帮助我吗?

onClipEvent(enterFrame){
   dx = _parent._xmouse-_x;
   dy = _parent._ymouse-_y;
   angle = Math.atan2(dy, dx);
   _rotation = angle * 180/Math.PI;
}

onClipEvent(enterFrame){
   if(Key.isDown(68)){
      this._x += 1.5;
   }
   if(Key.isDown(65)){
      this._x -= 1.5;
   }
   if(Key.isDown(87)){
      this._y -= 1.5;
   }
   if(Key.isDown(83)){
      this._y += 1.5;
   }
}
4

1 回答 1

0

这很可能与您正在处理的 MovieClip 的轴心点位于中心以外的其他位置有关。输入 flash,在你正在旋转的 mc 中,放置它,使质心位于 0,0

于 2012-08-14T06:21:06.130 回答