Improve example documentation.

This commit is contained in:
Jonathan Puckey 2013-03-03 20:10:25 +01:00
parent 801eb0f2a8
commit fa861f2047
2 changed files with 20 additions and 8 deletions

View file

@ -33,11 +33,15 @@ var PlacedSymbol = this.PlacedSymbol = PlacedItem.extend(/** @lends PlacedSymbol
*
* @example {@paperscript split=true height=240}
* // Placing 100 instances of a symbol:
* var path = new Path.Star(new Point(0, 0), 6, 5, 13);
* path.style = {
* fillColor: 'white',
* strokeColor: 'black'
* };
* // Create a star shaped path at {x: 0, y: 0}:
* var path = new Path.Star({
* center: new Point(0, 0),
* numPoints: 6,
* radius1: 5,
* radius2: 13,
* fillColor: 'white',
* strokeColor: 'black'
* });
*
* // Create a symbol from the path:
* var symbol = new Symbol(path);

View file

@ -33,11 +33,19 @@ var CompoundPath = this.CompoundPath = PathItem.extend(/** @lends CompoundPath#
*
* @example {@paperscript}
* // Create a circle shaped path with a hole in it:
* var circle = new Path.Circle(new Point(50, 50), 30);
* var innerCircle = new Path.Circle(new Point(50, 50), 10);
* var circle = new Path.Circle({
* center: new Point(50, 50),
* radius: 30
* });
*
* var innerCircle = new Path.Circle({
* center: new Point(50, 50),
* radius: 10
* });
*
* var compoundPath = new CompoundPath([circle, innerCircle]);
* compoundPath.fillColor = 'red';
*
*
* // Move the inner circle 5pt to the right:
* compoundPath.children[1].position.x += 5;
*/