SXBezierCurve

author:
Alessandro Maroso
description:
A customisable curved line.
lastupdate:
2014-11-10
compatible:
v2.1
tag:
line, curved, bezier, texture
homepage:
https://gist.github.com/membersheep/22db1a2a6b794b4fe1d7
download:
https://gist.github.com/membersheep/22db1a2a6b794b4fe1d7/download

Usage

This is a simple, dynamic and customisable curved line based on Bezier curves. For informations about the meaning and the usage of the control points check http://pomax.github.io/bezierinfo/

Sample:

self.curve = [[SXBezierCurve alloc]initWithStartPoint:[SPPoint pointWithX:0 y:0]
                                                            endPoint:[SPPoint pointWithX:0 y:100]
                                                       controlPoint1:[SPPoint pointWithX:100 y:20]
                                                       controlPoint2:[SPPoint pointWithX:80 y:80]];
    self.curve.x = 300;
    self.curve.y = 100;
    self.curve.color = SPColorNavy;
    self.curve.thickness = 5;
    [self addChild:self.curve];

Changelog

Source Code

Discussion

No comments so far. Feel free to edit this part of the page.