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

  • 2014/11/04 21:12: First public version
  • 2014/11/10 00:00: Added textured curve
  • 2014/11/20 14:46: Updated with 3 curve type (linear, quadratic, cubic) and new texturization.
  • 2014/12/18 14:46: Updated with new texturization (1 texture applied for the whole line, repeated if needed).

Source Code

Discussion

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

  extensions/sxbeizercurve.txt · Last modified: 2015/09/14 11:14 (external edit)
 
Powered by DokuWiki