- Base
- Circle
- CoordinateSystem
- Hierarchy
- Matrix
- Path
- Point
- RasterRenderer
todo
- rectangle
- bezier curve
- Shape
- TerminalRenderer
Kind: global class
Shape
set the absolute rotation
Kind: instance property of Base
| Param |
|---|
| angle |
Kind: instance property of Base
| Param | Type | Description |
|---|---|---|
| p | Point |
position passed to Point |
base.position β Point
Kind: instance property of Base
TODO to be replaced by super._changed() when the super implementations performance is better
Kind: instance property of Base
TODO to be replaced by super._parentChanged() when the super implementations performance is better
Kind: instance property of Base
Kind: instance property of Base
| Param | Type |
|---|---|
| m | Matrix |
base.matrix β Matrix
Kind: instance property of Base
Kind: instance method of Base
| Param | Type | Description |
|---|---|---|
| [levels] | Number |
how many levels to travel up the hierarchy |
base.getMatrix$([levels]) β Matrix
Kind: instance method of Base
| Param | Type |
|---|---|
| [levels] | Number |
Shape
| Param | Type | Description |
|---|---|---|
| position | Array | Object |
Point |
| radius | Number |
_radius |
Kind: global class
- Hierarchy
- .children β
Array.<Hierarchy> - .parent
- .parent β
Hierarchy - .addChildren(children) β
Hierarchy - .hasChildren() β
boolean - .hasParent() β
boolean - .setParent(p) β
Hierarchy - .removeChild(child)
- .removeChildren(children)
- .children β
hierarchy.children β Array.<Hierarchy>
Kind: instance property of Hierarchy
Kind: instance property of Hierarchy
| Param | Type |
|---|---|
| p | Hierarchy |
hierarchy.parent β Hierarchy
Kind: instance property of Hierarchy
hierarchy.addChildren(children) β Hierarchy
Kind: instance method of Hierarchy
| Param | Type |
|---|---|
| children | Hierarchy |
Kind: instance method of Hierarchy
Kind: instance method of Hierarchy
hierarchy.setParent(p) β Hierarchy
Kind: instance method of Hierarchy
| Param |
|---|
| p |
Kind: instance method of Hierarchy
| Param | Type |
|---|---|
| child | Hierarchy |
Kind: instance method of Hierarchy
| Param | Type |
|---|---|
| children | Array.<Hierarchy> |
Kind: global class
- Matrix
- .a β
Number - .b β
Number - .c β
Number - .d β
Number - .tx β
Number - .ty β
Number - .multiply(m)
- .multiplySelf(m)
- .multiplySelf_(m)
- .scale(sx, [sy])
- .inverse() β
Matrix - .determinant() β
Number - .isInvertible() β
boolean
- .a β
Kind: instance property of Matrix
Returns: Number - - a
Kind: instance property of Matrix
Returns: Number - - b
Kind: instance property of Matrix
Returns: Number - - c
Kind: instance property of Matrix
Returns: Number - - d
Kind: instance property of Matrix
Returns: Number - - tx
Kind: instance property of Matrix
Returns: Number - - ty
mul
Kind: instance method of Matrix
| Param | Type | Description |
|---|---|---|
| m | Matrix |
[ a b tx ] [ a b tx ] [ c d ty ] [ c d ty ] [ 0 0 1 ] [ 0 0 1 ] |
post this * m
Kind: instance method of Matrix
| Param | Type | Description |
|---|---|---|
| m | Matrix |
[ a b tx ] [ a b tx ] [ c d ty ] [ c d ty ] [ 0 0 1 ] [ 0 0 1 ] |
pre m * this
Kind: instance method of Matrix
| Param | Type | Description |
|---|---|---|
| m | Matrix |
[ a b tx ] [ a b tx ] [ c d ty ] [ c d ty ] [ 0 0 1 ] [ 0 0 1 ] |
Kind: instance method of Matrix
| Param | Type | Default | Description |
|---|---|---|---|
| sx | Number |
scaling in x, y or only x if no sy given | |
| [sy] | Number |
sx |
scaling in y direction |
matrix.inverse() β Matrix
Kind: instance method of Matrix
Kind: instance method of Matrix
Returns true if matrix is invertible
Kind: instance method of Matrix
Kind: global class
- Path
- new Path([arg0])
- instance
- static
| Param | Type |
|---|---|
| [arg0] | Array | number |
Example
new Path([Segment0, Segment1])
new Path([[3, 5], [3, 6]])
new Path([3, 5])
new Path()add a segment to the path
Kind: instance method of Path
| Param |
|---|
| segment |
Kind: instance method of Path
| Param | Type | Description |
|---|---|---|
| p0 | Number |
start Point |
| h0o | Number |
start Point handle out, relative to p0 |
| h1i | Number |
end Point handle in, relative to p1 |
| p1 | Number |
end Point |
| t | Number |
value between {0-1} => 0%-100% of the length |
Kind: static class of Path
| Param | Type |
|---|---|
| position | Point |
| [handleIn] | Point |
| [handleOut] | Point |
Kind: instance method of Segment
Kind: global class
- Point
- .constructor
- .set β
Object - .set$ β
Object - .coordinateSystem
- .position$ β
Point - .absoluteX β
Number - .absoluteY β
Number - .relativeX β
Number - .relativeY β
Number - .x β
Number - .x
- .x$ β
Number - .x$
- .y$ β
Number - .y$
- .y β
Number - .y
- .position
- .length
- .length β
Number - .add β
Object - .addSelf β
Object - .add β
Object - .distance β
Point - .distance$ β
Point - .lerp β
Point - .lerpSelf β
Point - ._parsePositionArgs β
Object - .transform(matrix) β
Point - .clone() β
Point - .transformSelf(m) β
Point - .multiplySelf(arg0, arg1) β
Point
Creates a Point object with the given x and y coordinates.
Kind: instance property of Point
| Param | Type | Default |
|---|---|---|
| [arg0] | Number | Array | Object |
0 |
| [arg1] | Number |
Example
new Point(5, 7);
new Point([5, 7]);
new Point({x:5, y:7});
new Point(new Point(5, 7));sets the coordinates
Kind: instance property of Point
Returns: Object - Point
| Param | Type | Description |
|---|---|---|
| arg0 | Number | Array | Object |
x |
| [arg1] | Number |
y |
Example
point.add(5, 7);
point.add([5, 7]);
point.add({x:5, y:7});
point.add(new Point(5, 7));sets the absolute coordinates
Kind: instance property of Point
Returns: Object - Point
| Param | Type | Description |
|---|---|---|
| arg0 | Number | Array | Object |
x |
| [arg1] | Number |
y |
Example
point.add(5, 7);
point.add([5, 7]);
point.add({x:5, y:7});
point.add(new Point(5, 7));Kind: instance property of Point
| Param |
|---|
| cos |
point.position$ β Point
Kind: instance property of Point
Kind: instance property of Point
Kind: instance property of Point
todo relative coordinates with capital chars
Kind: instance property of Point
Kind: instance property of Point
Kind: instance property of Point
Kind: instance property of Point
| Param | Type |
|---|---|
| x | Number |
Kind: instance property of Point
Kind: instance property of Point
| Param | Type |
|---|---|
| x$ | Number |
Kind: instance property of Point
Kind: instance property of Point
| Param | Type |
|---|---|
| y$ | Number |
Kind: instance property of Point
Kind: instance property of Point
| Param | Type |
|---|---|
| y | Number |
Kind: instance property of Point
| Param | Type |
|---|---|
| pos | Number | Array | Object |
Example
Point.position = [5, 7];
Point.position = {x:5, y:7};
Point.position = new Point(5, 7);The the vector to given length
Kind: instance property of Point
| Param | Type | Description |
|---|---|---|
| l | Number |
target length of the vector |
returns the current length
Kind: instance property of Point
adds and returns a new point
Kind: instance property of Point
Returns: Object - Point
| Param | Type |
|---|---|
| arg0 | Number |
| arg1 | Number |
Example
point.add(5, 7);adds to the current point
Kind: instance property of Point
Returns: Object - Point
| Param | Type |
|---|---|
| arg0 | Number | Array | Object |
| [arg1] | Number |
Example
point.add(5, 7);
point.add([5, 7]);
point.add({x:5, y:7});
point.add(new Point(5, 7));multiplies
Kind: instance property of Point
Returns: Object - Point
| Param | Type |
|---|---|
| arg0 | Number |
| arg1 | Number |
Example
point.add(5, 7);point.distance β Point
returns the distance between the absolute coordinates and a given point
Kind: instance property of Point
| Param | Type |
|---|---|
| arg0 | Number | Array | Object |
| [arg1] | Number |
Example
Point.distance(5, 7);
Point.distance([5, 7]);
Point.distance({x:5, y:7});
Point.distance(new Point(5, 7)); //relative x,y of Point
Point.distance((new Point(5, 7)).position$); //absolute x,y of Pointpoint.distance$ β Point
returns the distance between the absolute coordinates and a given point
Kind: instance property of Point
| Param | Type |
|---|---|
| arg0$ | Number | Array | Object |
| [arg1$] | Number |
Example
Point.distance$(5, 7);
Point.distance$([5, 7]);
Point.distance$({x:5, y:7});
Point.distance$(new Point(5, 7)); //relative x,y of Point
Point.distance$((new Point(5, 7)).position$); //absolute x,y of Pointpoint.lerp β Point
Kind: instance property of Point
| Param | Type |
|---|---|
| arg0 | Number | Array | Object |
| [arg1] | Number |
| p |
Example
Point.lerp(5, 7);
Point.lerp([5, 7]);
Point.lerp({x:5, y:7});
Point.lerp(new Point(5, 7));point.lerpSelf β Point
Kind: instance property of Point
| Param | Type |
|---|---|
| arg0 | Number | Array | Object |
| [arg1] | Number |
| p |
Example
Point.lerpSelf(5, 7);
Point.lerpSelf([5, 7]);
Point.lerpSelf({x:5, y:7});
Point.lerpSelf(new Point(5, 7));parses the input args and returns a point object with x and y coordinates
Kind: instance property of Point
| Param | Type |
|---|---|
| arg0 | Number | Array | Object |
| [arg1] | Number |
Example
_parsePositionArgs(5, 7);
_parsePositionArgs([5, 7]);
_parsePositionArgs({x:5, y:7});
_parsePositionArgs(new Point(5, 7));point.transform(matrix) β Point
returns a new transformed Point
Kind: instance method of Point
| Param |
|---|
| matrix |
point.clone() β Point
returns a copy of the point
Kind: instance method of Point
point.transformSelf(m) β Point
returns a new transformed Point
Kind: instance method of Point
Returns: Point - [a b tx] [ x ]
[c d ty] [ y ]
[0 0 1 ] [ 1 ]
| Param |
|---|
| m |
point.multiplySelf(arg0, arg1) β Point
Kind: instance method of Point
| Param | Description |
|---|---|
| arg0 | x |
| arg1 | y |
todo
- rectangle
- bezier curve
Kind: global class
renders all attached items or just the one given
Kind: instance method of RasterRenderer
| Param | Type |
|---|---|
| [Item] | Object |
Kind: instance method of RasterRenderer
| Param | Type | Description |
|---|---|---|
| Item | Object |
Geometry Item |
| [data] | Object |
e.g Array [R, G, B] colors range 0-255 |
Shape
Kind: global class
| Param | Type | Description |
|---|---|---|
| width | Number |
Width of the canvas |
| height | Number |
Height of the canvas |
| scale | Number |
Scale of the canvas |
Kind: instance property of TerminalRenderer
| Param | Type |
|---|---|
| debug | Boolean |
Kind: instance property of TerminalRenderer