需要一些有关石英 2d 的帮助,这对我来说是全新的。
基本上我的应用程序需要跟随触摸,从中心开始多次绘制这条线。问题是它必须是动态的,并且线条必须均匀分布(有点像章鱼从中心开始)。我在android上的方式是我记住数组中的形状路径,而不是通过旋转坐标系多次绘制它,但我不知道如何在iOS上做到这一点。
我的旋转功能
- (void) rotateContext:(int)angle
{
CGContextTranslateCTM(UIGraphicsGetCurrentContext(), self.center.x, self.center.y);
CGContextRotateCTM(UIGraphicsGetCurrentContext(), radians(angle));
CGContextTranslateCTM(UIGraphicsGetCurrentContext(), -self.center.x, -self.center.y);
}
仅当我尝试在 drawRect() 中执行此操作时它才有效,并且它会旋转所有路径。
你能建议我一个解决问题的好方法吗?
谢谢