Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // a: old position b: new position
- -(void)updateDrawPath:(CGPoint)a B:(CGPoint)b
- {
- CGMutablePathRef newPath = CGPathCreateMutable();
- CGPathMoveToPoint((newPath), NULL, a.x, a.y);
- CGPathAddLineToPoint(newPath, NULL, b.x, b.y);
- CGPathAddPath(_lineToDraw, NULL, newPath);
- _lineNode.path = _lineToDraw;
- }
- // Creates EffectNode, add's ShapeNode. Add's Effectnode to Scene as instructed.
- -(void)traceObject:(SKPlanetNode *)p
- {
- _effectNode = [[SKEffectNode alloc]init];
- _lineNode = [SKShapeNode node];
- _lineToDraw = CGPathCreateMutable();
- CGPathMoveToPoint((_lineToDraw), NULL, p.position.x, p.position.y);
- _lineNode.path = _lineToDraw;
- _lineNode.strokeColor = [SKColor whiteColor];
- _lineNode.antialiased = YES;
- _lineNode.lineWidth = 3;
- [_effectNode addChild:_lineNode];
- [self addChild:_effectNode];
- _effectNode.shouldRasterize = YES;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement