Questions tagged [uibezierpath]

The UIBezierPath class lets you define a path consisting of straight and curved line segments and render that path in your custom views.

The UIBezierPath class lets you define a path consisting of straight and curved line segments and render that path in your custom views. You use this class initially to specify just the geometry for your path. Paths can define simple shapes such as rectangles, ovals, and arcs or they can define complex polygons that incorporate a mixture of straight and curved line segments. After defining the shape, you can use additional methods of this class to render the path in the current drawing context.

Its counterpart in OS X is .

Resources:

1777 questions
0
votes
2 answers

html5 draw gaussian function using bezierCurveTo

I have been trying to draw gaussin-like function using bezierCurveTo find the code below Your browser does not support the HTML5 canvas…
Adorn
  • 1,403
  • 1
  • 23
  • 46
0
votes
1 answer

Objective-C UIBezierPath, physics body

I have clouds of different sizes ( seen in the picture ) and im trying to give them a physics body automatically. But I just dont get how to do it. I have a player, its just something like a Ball so I could go for bodyWithCircleOfRadius. I make it…
Alexxxx
  • 59
  • 7
0
votes
1 answer

using UIBezierPath for setting radius to some corners and adding shadow to Custom UIButton

I have a custom UIButton. I want to add radius to some corners (not to all of them) I'm using UIBezierPath for setting that. But because i'm masking the layer i cant add a shadow. For all corners it works: func setupView() { layer.cornerRadius =…
ilan
  • 4,402
  • 6
  • 40
  • 76
0
votes
1 answer

How to fit CAShapeLayer

I`m developing iPhone app, where i using next code to round two corners of my layer : CAShapeLayer *backgroundMaskLayer = [CAShapeLayer layer]; UIBezierPath *backgroungMaskPath = [UIBezierPath …
0
votes
1 answer

CAShapeLayer Random Fill Color

So I have a pie chart/color wheel that I made using CAShapeLayer and UIBezierPath. The wheel can have a max of 8 sections. I need it so each section is a different color. I've tried setting up an array (colorsArray) with different colors and…
dcotter
  • 312
  • 6
  • 22
0
votes
1 answer

Border clipped when drawing with bezierPathWithOvalInRect

I am drawing a circle in my custom UIView's drawRect: - (void)drawRect:(CGRect)rect { ... UIBezierPath *ovalPath = [UIBezierPath bezierPathWithOvalInRect:rect]; [UIColor.whiteColor setStroke]; ovalPath.lineWidth = 1; [ovalPath…
Boon
  • 40,656
  • 60
  • 209
  • 315
0
votes
0 answers

Draw Triangles inside Circle Objective-C

I'm attempting to make a rotary color wheel. The issue I'm having is trying to divide the circle into sections. I'm able to construct the wheel and I'm able to have it rotate but can't seem to figure out how to divide that wheel into triangular…
dcotter
  • 312
  • 6
  • 22
0
votes
1 answer

How to get the last point or current point from a uibezierpath?

I am adding a line from point to point. ... [self->path addLineToPoint:[touch locationInView:self]]; //need to check the point(x,y) against another point ?? [self setNeedsDisplay]; ... How to extract the last point?
jdl
  • 6,151
  • 19
  • 83
  • 132
0
votes
1 answer

Swift - Using UIBezierPath in a Subview

I'm trying to make a simple app. To do so, in part, I'm trying to use a subview to draw a circle on the screen. This is my view controller class: gameView is the view linked to in the the storyboard. ballView is the view I would like to add…
comp_sci5050
  • 145
  • 2
  • 11
0
votes
1 answer

drawRect method inside UIScrollView

I have a custom UIView inside UIScrollView with same size. And I am drawing UIBezierPath inside UIViews drawRect method. But when zooming changed in UIScrollView the drawRect method gets same rect always. So UIBezierPaths resolution is not…
AykutE
  • 344
  • 3
  • 15
0
votes
2 answers

How to make the line edge smooth?

I am trying to draw a cursor and I've used UIBezierPath to do so. Here is what I did : drawing line from the top pointer to the right edge. drawing line from the top pointer to the left edge. setting the bezierPath to a layer with width. here is…
david
  • 3,310
  • 7
  • 36
  • 59
0
votes
1 answer

Animate size of a bezier curve

I want to create a circular arc of a bezier curve and then animate it to reduce the radius of the curve. Currently I have the following code to draw my bezier curve in a UIView: UIView * curveView = [[UIView alloc] initWithFrame:CGRectMake(50, 550,…
sam_smith
  • 6,023
  • 3
  • 43
  • 60
0
votes
1 answer

Fast alternatives to UIBezierPath for drawing a large number of squares to a custom view

I'm making an app that draws elementary cellular automata. Currently I'm using UIBezierPath to draw the cells in a custom UIView: var path : UIBezierPath for (heightIndex, row) in stateMatrix!.enumerate() { for (widthIndex, cell) in…
c_booth
  • 2,185
  • 1
  • 13
  • 22
0
votes
2 answers

UIGestureRecognizer is only added for subView but it is also working on parentView?

Here is my code : [super viewDidLoad]; UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureRecognizer:)]; [self.colorView setUserInteractionEnabled:YES]; [self.colorView…
0
votes
0 answers

Image clipping with path (scaling issue)

The app I am using for testing puposes is able to take a picture and save it as a PNG file. The next time the app is launched, it checks if a file is present and if it is, the image stored inside the file is used as the background view of the app.…
Michel
  • 10,303
  • 17
  • 82
  • 179