Class: Primitive

Primitive()

Base class of all primitives. Handles position, rotation, color and stroke weight. Creates the command list for those properties.

Constructor

new Primitive()

Source:

Classes

Primitive
Primitive

Methods

color(fillColor, strokeColor) → {Primitive}

Set the color of the primitive.
Parameters:
Name Type Description
fillColor Color the color to use
strokeColor Color the stroke color to use, may be null then it uses the fill color.
Source:
Returns:
- the primitive
Type
Primitive

color(fillColor, strokeColor) → {Primitive}

Set the color of the primitive.
Parameters:
Name Type Description
fillColor Color the color to use
strokeColor Color the stroke color to use, may be null then it uses the fill color.
Source:
Returns:
- the primitive
Type
Primitive

dofill(fill) → {Primitive}

Specify if the primitive shape should be filled with the fill color.
Parameters:
Name Type Default Description
fill boolean true should fill the shape
Source:
Returns:
Type
Primitive

dofill(fill) → {Primitive}

Specify if the primitive shape should be filled with the fill color.
Parameters:
Name Type Default Description
fill boolean true should fill the shape
Source:
Returns:
Type
Primitive

dostroke(stroke) → {Primitive}

Specify if the primitive shape should be stroked with the stroke color.
Parameters:
Name Type Default Description
stroke boolean true should stroke the shape
Source:
Returns:
Type
Primitive

dostroke(stroke) → {Primitive}

Specify if the primitive shape should be stroked with the stroke color.
Parameters:
Name Type Default Description
stroke boolean true should stroke the shape
Source:
Returns:
Type
Primitive

genCmdList() → {Array}

--- INTERNAL --- Generate the command list for the primitive
Source:
Returns:
Type
Array

genCmdList() → {Array}

--- INTERNAL --- Generate the command list for the primitive
Source:
Returns:
Type
Array

nofill() → {Primitive}

Don't fill the shape. Shorthand for dofill(false)
Source:
Returns:
Type
Primitive

nofill() → {Primitive}

Don't fill the shape. Shorthand for dofill(false)
Source:
Returns:
Type
Primitive

nostroke() → {Primitive}

Don't stroke the shape. Shorthand for dostroke(false)
Source:
Returns:
Type
Primitive

nostroke() → {Primitive}

Don't stroke the shape. Shorthand for dostroke(false)
Source:
Returns:
Type
Primitive

rotation(rotation) → {Primitive}

Specify the rotation of the primitive. It gets rotated around the point of the position.
Parameters:
Name Type Description
rotation number the rotation in radians
Source:
Returns:
Type
Primitive

rotation(rotation) → {Primitive}

Specify the rotation of the primitive. It gets rotated around the point of the position.
Parameters:
Name Type Description
rotation number the rotation in radians
Source:
Returns:
Type
Primitive

strokeWeight(weight) → {Primitive}

Set the stroke weight (aka width) of the stroke lines.
Parameters:
Name Type Description
weight number the stroke weight
Source:
Returns:
- the primitive
Type
Primitive

strokeWeight(weight) → {Primitive}

Set the stroke weight (aka width) of the stroke lines.
Parameters:
Name Type Description
weight number the stroke weight
Source:
Returns:
- the primitive
Type
Primitive

x(x) → {Primitive}

Set the X coordinate of the primitive.
Parameters:
Name Type Description
x number the x coordinate
Source:
Returns:
- the primitive
Type
Primitive

x(x) → {Primitive}

Set the X coordinate of the primitive.
Parameters:
Name Type Description
x number the x coordinate
Source:
Returns:
- the primitive
Type
Primitive

xy(x, y) → {Primitive}

Set the X and Y coordinates of the primitive.
Parameters:
Name Type Description
x number the x coordinate
y number the y coordinate
Source:
Returns:
- the primitive
Type
Primitive

xy(x, y) → {Primitive}

Set the X and Y coordinates of the primitive.
Parameters:
Name Type Description
x number the x coordinate
y number the y coordinate
Source:
Returns:
- the primitive
Type
Primitive

y(y) → {Primitive}

Set the Y coordinate of the primitive.
Parameters:
Name Type Description
y number the y coordinate
Source:
Returns:
- the primitive
Type
Primitive

y(y) → {Primitive}

Set the Y coordinate of the primitive.
Parameters:
Name Type Description
y number the y coordinate
Source:
Returns:
- the primitive
Type
Primitive

PrimitivePrimitive()

Base class of all primitives. Handles position, rotation, color and stroke weight. Creates the command list for those properties.

Constructor

new Primitive()

Source:

Classes

Primitive
Primitive

Methods

color(fillColor, strokeColor) → {Primitive}

Set the color of the primitive.
Parameters:
Name Type Description
fillColor Color the color to use
strokeColor Color the stroke color to use, may be null then it uses the fill color.
Source:
Returns:
- the primitive
Type
Primitive

color(fillColor, strokeColor) → {Primitive}

Set the color of the primitive.
Parameters:
Name Type Description
fillColor Color the color to use
strokeColor Color the stroke color to use, may be null then it uses the fill color.
Source:
Returns:
- the primitive
Type
Primitive

dofill(fill) → {Primitive}

Specify if the primitive shape should be filled with the fill color.
Parameters:
Name Type Default Description
fill boolean true should fill the shape
Source:
Returns:
Type
Primitive

dofill(fill) → {Primitive}

Specify if the primitive shape should be filled with the fill color.
Parameters:
Name Type Default Description
fill boolean true should fill the shape
Source:
Returns:
Type
Primitive

dostroke(stroke) → {Primitive}

Specify if the primitive shape should be stroked with the stroke color.
Parameters:
Name Type Default Description
stroke boolean true should stroke the shape
Source:
Returns:
Type
Primitive

dostroke(stroke) → {Primitive}

Specify if the primitive shape should be stroked with the stroke color.
Parameters:
Name Type Default Description
stroke boolean true should stroke the shape
Source:
Returns:
Type
Primitive

genCmdList() → {Array}

--- INTERNAL --- Generate the command list for the primitive
Source:
Returns:
Type
Array

genCmdList() → {Array}

--- INTERNAL --- Generate the command list for the primitive
Source:
Returns:
Type
Array

nofill() → {Primitive}

Don't fill the shape. Shorthand for dofill(false)
Source:
Returns:
Type
Primitive

nofill() → {Primitive}

Don't fill the shape. Shorthand for dofill(false)
Source:
Returns:
Type
Primitive

nostroke() → {Primitive}

Don't stroke the shape. Shorthand for dostroke(false)
Source:
Returns:
Type
Primitive

nostroke() → {Primitive}

Don't stroke the shape. Shorthand for dostroke(false)
Source:
Returns:
Type
Primitive

rotation(rotation) → {Primitive}

Specify the rotation of the primitive. It gets rotated around the point of the position.
Parameters:
Name Type Description
rotation number the rotation in radians
Source:
Returns:
Type
Primitive

rotation(rotation) → {Primitive}

Specify the rotation of the primitive. It gets rotated around the point of the position.
Parameters:
Name Type Description
rotation number the rotation in radians
Source:
Returns:
Type
Primitive

strokeWeight(weight) → {Primitive}

Set the stroke weight (aka width) of the stroke lines.
Parameters:
Name Type Description
weight number the stroke weight
Source:
Returns:
- the primitive
Type
Primitive

strokeWeight(weight) → {Primitive}

Set the stroke weight (aka width) of the stroke lines.
Parameters:
Name Type Description
weight number the stroke weight
Source:
Returns:
- the primitive
Type
Primitive

x(x) → {Primitive}

Set the X coordinate of the primitive.
Parameters:
Name Type Description
x number the x coordinate
Source:
Returns:
- the primitive
Type
Primitive

x(x) → {Primitive}

Set the X coordinate of the primitive.
Parameters:
Name Type Description
x number the x coordinate
Source:
Returns:
- the primitive
Type
Primitive

xy(x, y) → {Primitive}

Set the X and Y coordinates of the primitive.
Parameters:
Name Type Description
x number the x coordinate
y number the y coordinate
Source:
Returns:
- the primitive
Type
Primitive

xy(x, y) → {Primitive}

Set the X and Y coordinates of the primitive.
Parameters:
Name Type Description
x number the x coordinate
y number the y coordinate
Source:
Returns:
- the primitive
Type
Primitive

y(y) → {Primitive}

Set the Y coordinate of the primitive.
Parameters:
Name Type Description
y number the y coordinate
Source:
Returns:
- the primitive
Type
Primitive

y(y) → {Primitive}

Set the Y coordinate of the primitive.
Parameters:
Name Type Description
y number the y coordinate
Source:
Returns:
- the primitive
Type
Primitive