Path

Wick. Path

Represents a Wick Path.

Constructor

new Path(json, path)

Description:
  • Create a Wick Path.

Source:
Parameters:
Name Type Description
json array

Path data exported from paper.js using exportJSON({asString:false}).

path Paper.Path

A Paper.js Path object to use as this Path's svg data. Optional if json was not passed in.

Members

bounds :object

Description:
  • The bounding box of the path.

Source:

The bounding box of the path.

Type:
  • object

fillColor :paper.Color

Description:
  • The fill color of the path.

Source:

The fill color of the path.

Type:
  • paper.Color

fontFamily :string

Description:
  • The font family of the path.

Source:

The font family of the path.

Type:
  • string

fontSize :number

Description:
  • The font size of the path.

Source:

The font size of the path.

Type:
  • number

fontStyle :string

Description:
  • The font style of the path ('italic' or 'oblique').

Source:

The font style of the path ('italic' or 'oblique').

Type:
  • string

fontWeight :number

Description:
  • The font weight of the path.

Source:

The font weight of the path.

Type:
  • number

isDynamicText :boolean

Description:
  • Check if this path is a dynamic text object.

Source:

Check if this path is a dynamic text object.

Type:
  • boolean

isPlaceholder :bool

Description:
  • Is this path used as a placeholder for preventing empty clips?

Source:

Is this path used as a placeholder for preventing empty clips?

Type:
  • bool

json :object

Description:
  • Path data exported from paper.js using exportJSON({asString:false}).

Source:

Path data exported from paper.js using exportJSON({asString:false}).

Type:
  • object

onScreen

Description:
  • Determines if this Path is visible in the project.

Source:

Determines if this Path is visible in the project.

opacity :number

Description:
  • The opacity of the path.

Source:

The opacity of the path.

Type:
  • number

originalStyle :object

Description:
  • The original style of the path (used to recover the path's style if it was changed by a custom onion skin style)

Source:

The original style of the path (used to recover the path's style if it was changed by a custom onion skin style)

Type:
  • object

pathType

Description:
  • The type of path that this path is. Can be 'path', 'text', or 'image'

Source:

The type of path that this path is. Can be 'path', 'text', or 'image'

strokeColor :paper.Color

Description:
  • The stroke color of the path.

Source:

The stroke color of the path.

Type:
  • paper.Color

strokeWidth :number

Description:
  • The stroke width of the path.

Source:

The stroke width of the path.

Type:
  • number

textContent :string

Description:
  • The content of the text.

Source:

The content of the text.

Type:
  • string

x :number

Description:
  • The position of the path.

Source:

The position of the path.

Type:
  • number

y :number

Description:
  • The position of the path.

Source:

The position of the path.

Type:
  • number

Methods

(static) booleanOp(paths, booleanOpName)

Description:
  • Perform a paper.js boolean operation on a list of paths.

Source:
Parameters:
Name Type Description
paths Array.<Wick.Path>

a list of paths to perform the boolean operation on.

booleanOpName string

the name of the boolean operation to perform. Currently supports "unite", "subtract", and "intersect"

(static) createImagePath(asset, callback)

Description:
  • Create a path containing an image from an ImageAsset.

Source:
Parameters:
Name Type Description
asset Wick.ImageAsset

The asset from which the image src will be loaded from

callback function

A function that will be called when the image is done loading.

(static) createImagePathSync(asset)

Description:
  • Create a path (synchronously) containing an image from an ImageAsset.

Source:
Parameters:
Name Type Description
asset Wick.ImageAsset

The asset from which the image src will be loaded from

(static) intersect(paths) → {Wick.Path}

Description:
  • Creates a new path using boolean intersection on multiple paths. The resulting path will use the fillColor, strokeWidth, and strokeColor of the first path in the array.

Source:
Parameters:
Name Type Description
paths Array.<Wick.Path>

an array containing the paths to process.

Returns:

The path resulting from the boolean intersection.

Type
Wick.Path

(static) subtract(paths) → {Wick.Path}

Description:
  • Creates a new path using boolean subtration on multiple paths. The resulting path will use the fillColor, strokeWidth, and strokeColor of the first path in the array.

Source:
Parameters:
Name Type Description
paths Array.<Wick.Path>

an array containing the paths to process.

Returns:

The path resulting from the boolean subtraction.

Type
Wick.Path

(static) unite(paths) → {Wick.Path}

Description:
  • Creates a new path using boolean unite on multiple paths. The resulting path will use the fillColor, strokeWidth, and strokeColor of the first path in the array.

Source:
Parameters:
Name Type Description
paths Array.<Wick.Path>

an array containing the paths to process.

Returns:

The path resulting from the boolean unite.

Type
Wick.Path

flatten() → {Wick.Path}

Description:
  • Converts a stroke into fill. Only works with paths that have a strokeWidth and strokeColor, and have no fillColor. Does nothing otherwise.

Source:
Returns:

A flattened version of this path. Can be null if the path cannot be flattened.

Type
Wick.Path

getLinkedAssets() → {Array.<Wick.Asset>}

Description:
  • The image asset that this path uses, if this path is a Raster path.

Source:
Returns:
Type
Array.<Wick.Asset>

remove()

Description:
  • Removes this path from its parent frame.

Source:

setText()

Description:
  • API function to change the textContent of dynamic text paths.

Source:

updateJSON()

Description:
  • Update the JSON of the path based on the path on the view.

Source: