0
我想弄清楚如何做到这一点,以便当我移动一个物体时,我并不是将它“保持”在物体的中心,而是朝向左侧或右侧。这是到目前为止我的代码...iPhone SDK触摸感动?
-
(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *myTouch = [[event allTouches] anyObject];
image1.center = [myTouch locationInView:self.view];
image1.image = [UIImage imageNamed:@"image1.png"];
}
我猜想这是因为image1.center的,但如何让这个它被感动别的地方,不是中心?