Layer

Wick. Layer

Represents a Wick Layer.

Constructor

new Layer(locked, hideen)

Description:
  • Called when creating a Wick Layer.

Source:
Parameters:
Name Type Description
locked boolean

Is the layer locked?

hideen boolean

Is the layer hidden?

Members

activeFrame :Wick.Frame

Description:
  • The active frame on the layer.

Source:

The active frame on the layer.

Type:

frames :Array.<Wick.Frame>

Description:
  • The frames belonging to this layer.

Source:

The frames belonging to this layer.

Type:

index :number

Description:
  • The order of the Layer in the timeline.

Source:

The order of the Layer in the timeline.

Type:
  • number

isActive :boolean

Description:
  • True if this layer is the active layer in its timeline.

Source:

True if this layer is the active layer in its timeline.

Type:
  • boolean

length :number

Description:
  • The length of the layer in frames.

Source:

The length of the layer in frames.

Type:
  • number

Methods

activate()

Description:
  • Set this layer to be the active layer in its timeline.

Source:

addFrame(frame)

Description:
  • Adds a frame to the layer.

Source:
Parameters:
Name Type Description
frame Wick.Frame

The frame to add to the Layer.

addTween(tween)

Description:
  • Adds a tween to the active frame of this layer (if one exists).

Source:
Parameters:
Name Type Description
tween Wick.Tween

the tween to add

findGaps() → {Array.<Object>}

Description:
  • Generate a list of positions where there is empty space between frames.

Source:
Returns:

An array of objects with start/end positions describing gaps.

Type
Array.<Object>

getFrameAtPlayheadPosition(playheadPosition) → {Wick.Frame}

Description:
  • Gets the frame at a specific playhead position.

Source:
Parameters:
Name Type Description
playheadPosition number

Playhead position to search for frame at.

Returns:

The frame at the given playheadPosition.

Type
Wick.Frame

getFramesContainedWithin(playheadPositionStart, playheadPositionEnd) → {Array.<Wick.Frame>}

Description:
  • Gets all frames in the layer that are contained within the two given playhead positions.

Source:
Parameters:
Name Type Description
playheadPositionStart number

The start of the range to search

playheadPositionEnd number

The end of the range to search

Returns:

The frames contained in the given range.

Type
Array.<Wick.Frame>

getFramesInRange(playheadPositionStart, playheadPositionEnd) → {Array.<Wick.Frame>}

Description:
  • Gets all frames in the layer that are between the two given playhead positions.

Source:
Parameters:
Name Type Description
playheadPositionStart number

The start of the range to search

playheadPositionEnd number

The end of the range to search

Returns:

The frames in the given range.

Type
Array.<Wick.Frame>

insertBlankFrame(playheadPosition)

Description:
  • Adds a frame to the layer. If there is an existing frame where the new frame is inserted, then the existing frame will be cut, and the new frame will fill the gap created by that cut.

Source:
Parameters:
Name Type Description
playheadPosition number

Where to add the blank frame.

move(index)

Description:
  • Moves this layer to a different position, inserting it before/after other layers if needed.

Source:
Parameters:
Name Type Description
index number

the new position to move the layer to.

remove()

Description:
  • Remove this layer from its timeline.

Source:

removeFrame(frame)

Description:
  • Removes a frame from the Layer.

Source:
Parameters:
Name Type Description
frame Wick.Frame

Frame to remove.

resolveGaps()

Description:
  • Prevents gaps between frames by extending frames to fill empty space between themselves.

Source:

resolveOverlap(newOrModifiedFrames)

Description:
  • Prevents frames from overlapping each other by removing pieces of frames that are touching.

Source:
Parameters:
Name Type Description
newOrModifiedFrames Array.<Wick.Frame>

the frames that should take precedence when determining which frames should get "eaten".