Questions tagged [cgpath]

A graphics path is a mathematical description of a series of shapes or lines. CGPath defines an opaque type that represents an immutable graphics path.The issue related with this tag can be tagged using [tag:CGPath] in iOS

CGPath is available in apple "CoreGraphics" framework.CGPaths are how CoreGraphics describes the bezier paths it uses for drawing to the screen. They can go a long way to unlocking some of the power of CoreGraphics.

For More information:

CGPath related question in SO:

Related Tags:

446 questions
0
votes
0 answers

Performance when updating UIBezierPath

I'm working on a Mind Mapping app that lets users structure their ideas. When the user adds an idea it is displayed into a UIScrollView in the form of a colored bubble. Except for the main bubble, each and every other bubble is linked with an…
Stefan Iarca
  • 152
  • 1
  • 7
0
votes
1 answer

How to find a CGPath from the boundary of DIFFERENCE between two overlapping shapes

its been long time I am asking a question on SO. Please feel free to suggest any edits or clarifications I want to write a method that takes two rects (Primary and secondary) and if they rects intersect it will give me a CGPath which is on the…
geekay
  • 1,655
  • 22
  • 31
0
votes
1 answer

CoreGraphics Drawing Correction

The code below draws the following. One can notice the left side line has thin line as compare to that on right. Other observation the Quad curve is not so sharp. How can I make it look better? - (void)drawRect:(CGRect)rect { CGContextRef…
NNikN
  • 3,720
  • 6
  • 44
  • 86
0
votes
1 answer

Draw a line to the given point and degrees on a view in ios?

i have a situation where the user will tap on the screen and enters the degrees and a line should to be draw from the tapped point in the given degree. i am using the following path code to draw the line but i am not able to draw the line in the…
ios Dev
  • 68
  • 7
0
votes
1 answer

SKSprite following CGMutablePath alignment

I'm confused on what is going on here. I know its supposed to be some coordinate shift, but when I use a circle for the path it traces it exactly. If I use a curve as below this is the result I get. I just want to draw the curve then have a…
Cherr Skees
  • 1,508
  • 2
  • 21
  • 37
0
votes
2 answers

Draw the Path of a Moving SKSpritenode

I am Trying to use the new SKSpritenode , i have managed to create a Spritenode move it around the screen , although i want the Spritenode leaves a trace( color ) where it moves. the code to create the Sprite node & my attempts to create a…
TALAA
  • 6,184
  • 1
  • 13
  • 21
0
votes
1 answer

Position during a CAAnimation

I'm using this to animate an object along a path. I'd like to know how to get the position of the object at any point during the animation to check for a collision with another object. Any ideas how to go about this? Thanks. - (void)…
Cherr Skees
  • 1,508
  • 2
  • 21
  • 37
0
votes
1 answer

SKAction followPath, creating the path

I am using a simple A* Pathfinding algorithm to create a path between two points (the green and red circles below), each square is an SKSpriteNode (with a CGPoint [x,y] position). I want to animate another SKSpriteNode along a smooth path that…
fuzzygoat
  • 26,573
  • 48
  • 165
  • 294
0
votes
2 answers

Sprite Kit/ SKShapeNode: excluding overlap of shapes

I'm trying to create a crescent moon effect by using two overlapping circles. My thinking was that I could subtract one from the other, but I'm having trouble executing it. Here's how I've coded the paths (the second path is overlaps the first one…
MassivePenguin
  • 3,701
  • 4
  • 24
  • 46
0
votes
1 answer

SKSpriteNode not affected by gravity for custom physicsBody

I am creating a custom edge path for a SKSpriteNode's physicsBody. CGMutablePathRef edgePath = CGPathCreateMutable(); CGPathMoveToPoint(edgePath, NULL, -100, -70); CGPathAddLineToPoint(edgePath, NULL, -100, 40); CGPathAddLineToPoint(edgePath, NULL,…
ZeMoon
  • 20,054
  • 5
  • 57
  • 98
0
votes
2 answers

Get area and perimeter of a UIBezierPath IOS

I have a UIBezierPath: CGPathRef tapTargetPath = CGPathCreateCopyByStrokingPath(tracePath.CGPath, NULL, marginError, tracePath.lineCapStyle, tracePath.lineJoinStyle, tracePath.miterLimit); UIBezierPath *tracePath = [UIBezierPath…
Fernando Santiago
  • 2,128
  • 10
  • 44
  • 75
0
votes
1 answer

objective-c: drawRect - path draws incomplete

I'm trying to draw a hexagon and have been following a couple of tutorials online. But I must be doing something wrong as my results are always an incomplete path. Initially I thought it was because I was making the view frame too small but even…
PruitIgoe
  • 6,166
  • 16
  • 70
  • 137
0
votes
2 answers

Create multiple CGPath in a loop

I am creating a program containing a map, in order to check in which region a mouseDown is occurring I want to create a CGPath per region. For the moment I create this part : int brestPoints[] =…
The Tom
  • 2,790
  • 6
  • 29
  • 33
0
votes
1 answer

SpriteKit SKPhysicsBody from CGPath polygon issue

I'm having trouble drawing an SKPhysicsBody with a polygonal shape that's supposed to look like a halfpipe. The code I've got is as follows: _halfpipe_left = [SKSpriteNode spriteNodeWithImageNamed:@"halfpipe_left"]; _halfpipe_left.position =…
0
votes
3 answers

How to create a category to extend CGPaths?

I would like to create a category to "extend" the "class" of CGPath and add more functionality. Because CGPath is not a regular object of ObjectiveC how do I do that? Excuse my lack of knowledge about c/c++
Duck
  • 34,902
  • 47
  • 248
  • 470