Clip

Wick. Clip

A class representing a Wick Clip.

Constructor

new Clip(identifier, objects, transformation)

Description:
  • Create a new clip.

Source:
Parameters:
Name Type Description
identifier string

The identifier of the new clip.

objects Wick.Path | Array.<Wick.Clip>

Optional. A list of objects to add to the clip.

transformation Wick.Transformation

Optional. The initial transformation of the clip.

Members

(static) animationTypes :Object

Description:
  • Returns a list of all possible animation types for this object.

Source:

Returns a list of all possible animation types for this object.

Type:
  • Object

activeFrame :Wick.Frame

Description:
  • The active frame of the clip's timeline.

Source:

The active frame of the clip's timeline.

Type:

activeLayer :Wick.Layer

Description:
  • The active layer of the clip's timeline.

Source:

The active layer of the clip's timeline.

Type:

activeNamedChildren :Array.<Wick.Base>

Description:
  • An array containing every clip and frame that is a child of this clip and has an identifier, and also is visible on screen.

Source:

An array containing every clip and frame that is a child of this clip and has an identifier, and also is visible on screen.

Type:

animationType :string

Description:
  • The animation type of the clip. Must be of a type represented within animationTypes;

Source:

The animation type of the clip. Must be of a type represented within animationTypes;

Type:
  • string

assetSourceUUID :string

Description:
  • The uuid of the ClipAsset that this clip was created from.

Source:

The uuid of the ClipAsset that this clip was created from.

Type:
  • string

bounds :object

Description:
  • The bounding box of the clip.

Source:

The bounding box of the clip.

Type:
  • object

clones :Array.<Wick.Clip>

Description:
  • An array containing all objects that were created by calling clone() on this Clip.

Source:

An array containing all objects that were created by calling clone() on this Clip.

Type:

currentFrameName

Description:
  • Returns the name of the frame which is currently active. If multiple frames are active, returns the name of the first active frame.

Source:

Returns the name of the frame which is currently active. If multiple frames are active, returns the name of the first active frame.

currentFrameNumber

Source:
Deprecated:
  • Returns the current playhead position. This is a legacy function, you should use clip.playheadPosition instead.

height :number

Description:
  • The height of the clip.

Source:

The height of the clip.

Type:
  • number

isClone :boolean

Description:
  • Check if a Clip is a clone of another object.

Source:

Check if a Clip is a clone of another object.

Type:
  • boolean

isFocus :boolean

Description:
  • Determines whether or not the clip is the currently focused clip in the project.

Source:

Determines whether or not the clip is the currently focused clip in the project.

Type:
  • boolean

isRoot :boolean

Description:
  • Determines whether or not the clip is the root clip in the project.

Source:

Determines whether or not the clip is the root clip in the project.

Type:
  • boolean

isSynced :boolean

Description:
  • True if the clip should sync to the timeline's position.

Source:

True if the clip should sync to the timeline's position.

Type:
  • boolean

lineage

Description:
  • The list of parents, grandparents, grand-grandparents...etc of the clip.

Source:

The list of parents, grandparents, grand-grandparents...etc of the clip.

namedChildren :Array.<Wick.Base>

Description:
  • An array containing every clip and frame that is a child of this clip and has an identifier.

Source:

An array containing every clip and frame that is a child of this clip and has an identifier.

Type:

onScreen :boolean

Description:
  • Determines whether or not the clip is visible in the project.

Source:

Determines whether or not the clip is visible in the project.

Type:
  • boolean

opacity :number

Description:
  • The opacity of the clip.

Source:

The opacity of the clip.

Type:
  • number

playedOnce :boolean

Description:
  • Returns true if the clip has been played through fully once.

Source:

Returns true if the clip has been played through fully once.

Type:
  • boolean

rotation :number

Description:
  • The rotation of the clip.

Source:

The rotation of the clip.

Type:
  • number

scaleX :number

Description:
  • The X scale of the clip.

Source:

The X scale of the clip.

Type:
  • number

scaleY :number

Description:
  • The Y scale of the clip.

Source:

The Y scale of the clip.

Type:
  • number

singleFrameNumber :number

Description:
  • The frame to display when animation type is set to singleFrame.

Source:

The frame to display when animation type is set to singleFrame.

Type:
  • number

sourceClip

Description:
  • Returns the source clip of this clip if this clip is a clone. Null otherwise.

Source:

Returns the source clip of this clip if this clip is a clone. Null otherwise.

sourceClipUUID :string

Description:
  • The uuid of the clip that this clip was cloned from.

Source:

The uuid of the clip that this clip was cloned from.

Type:
  • string

syncFrame :number

Description:
  • The frame to display when the clip is synced

Source:

The frame to display when the clip is synced

Type:
  • number

timeline :Wick.Timeline

Description:
  • The timeline of the clip.

Source:

The timeline of the clip.

Type:

transformation :Wick.Transformation

Description:
  • The current transformation of the clip.

Source:

The current transformation of the clip.

Type:

width :number

Description:
  • The width of the clip.

Source:

The width of the clip.

Type:
  • number

x :number

Description:
  • The X position of the clip.

Source:

The X position of the clip.

Type:
  • number

y :number

Description:
  • The Y position of the clip.

Source:

The Y position of the clip.

Type:
  • number

Methods

addObjects(objects)

Description:
  • Add paths and clips to this clip.

Source:
Parameters:
Name Type Description
objects Array.<Wick.Base>

the paths and clips to add to the clip

applySingleFramePosition()

Description:
  • Updates the frame's single frame positions if necessary. Only works if the clip's animationType is 'single'.

Source:

applySyncPosition()

Description:
  • Updates the clip's playhead position if the Clip is in sync mode

Source:

breakApart() → {Array.<Wick.Base>}

Description:
  • Remove this clip and add all of its paths and clips to its parent frame.

Source:
Returns:

the objects that were inside the clip.

Type
Array.<Wick.Base>

circleHits(other, options) → {object}

Description:
  • Perform circular hit test with other clip.

Source:
Parameters:
Name Type Description
other Wick.Clip

the clip to hit test with

options object

Hit test options

Returns:

Hit information

Type
object

clone() → {Wick.Clip}

Description:
  • Copy this clip, and add the copy to the same frame as the original clip.

Source:
Returns:

the result of the clone.

Type
Wick.Clip

convexHits(other, options) → {object}

Description:
  • Perform convex hull hit test with other clip.

Source:
Parameters:
Name Type Description
other Wick.Clip

the clip to hit test with

options object

Hit test options

Returns:

Hit information

Type
object

ensureActiveFrameIsContentful()

Description:
  • Add a placeholder path to this clip to ensure the Clip is always selectable when rendered.

Source:

gotoAndPlay(frame)

Description:
  • Moves a clip's playhead to a specific position and plays that clip's timeline from that position.

Source:
Parameters:
Name Type Description
frame number | string

number or string representing the frame to move the playhead to.

gotoAndStop(frame)

Description:
  • Moves a clip's playhead to a specific position and stops that clip's timeline on that position.

Source:
Parameters:
Name Type Description
frame number | string

number or string representing the frame to move the playhead to.

gotoNextFrame()

Description:
  • Move the playhead of the clips timeline forward one frame. Does nothing if the clip is on its last frame.

Source:

gotoPrevFrame()

Description:
  • Move the playhead of the clips timeline backwards one frame. Does nothing if the clip is on its first frame.

Source:

hits(other, options) → {object}

Description:
  • Perform hit test with other clip.

Source:
Parameters:
Name Type Description
other Wick.Clip

the clip to hit test with

options object

Hit test options

Returns:

Hit information

Type
object

hitTest(other) → {boolean}

Description:
  • Returns true if this clip collides with another clip.

Source:
Parameters:
Name Type Description
other Wick.Clip

The other clip to check collision with.

Returns:

True if this clip collides the other clip.

Type
boolean

play()

Description:
  • Plays a clip's timeline from that clip's current playhead position.

Source:

radiusAtPointInDirection(ch, p, targetTheta) → {number}

Description:
  • Casts a ray from p in the direction targetTheta and intersects it with the hull ch, returns the distance from p to the surface of ch.

Source:
Parameters:
Name Type Description
ch list

the convex hull to intersect a ray with

p object

the point of origin of the ray

targetTheta number

the direction of the ray

Returns:

the distance to the surface of the convex hull from the point in the direction theta

Type
number

rectangleHits(other, options) → {object}

Description:
  • Perform rectangular hit test with other clip.

Source:
Parameters:
Name Type Description
other Wick.Clip

the clip to hit test with

options object

Hit test options

Returns:

Hit information

Type
object

remove()

Description:
  • Remove this clip from its parent frame.

Source:

removeClone(uuid)

Description:
  • Remove a clone from the clones array by uuid.

Source:
Parameters:
Name Type Description
uuid string

resetTimelinePosition()

Description:
  • Resets the clip's timeline position.

Source:

setText()

Description:
  • This is a stopgap to prevent users from using setText with a Clip.

Source:

stop()

Description:
  • Stops a clip's timeline on that clip's current playhead position.

Source:

updateTimelineForAnimationType()

Description:
  • Updates the timeline of the clip based on the animation type of the clip.

Source: