mercredi 20 juillet 2016

Drawing a Hexagon with UIBezierPath (point first)

I am trying to draw a Hexagon using UIBezierPath and ZEPolygon, it works great but my hexagon is flat on top. I have tried everything to get it to draw form a point in the middle including a 180 degree transform on the path which work but everything else break. This is how it looks now This is how i would like it to look My code is below UIImageView *maskedImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image.png"]]; UIBezierPath *nonagon = [UIBezierPath bezierPathWithPolygonInRect:maskedImageView.frame numberOfSides:6]; CAShapeLayer *shapeLayer = [CAShapeLayer layer]; shapeLayer.path = nonagon.CGPath; maskedImageView.layer.mask = shapeLayer; [self.view addSubview:maskedImageView]; This is the library i used for the drawing the bezier path Thanks for any help

Aucun commentaire:

Enregistrer un commentaire