Base

Wick. Base

The base class for all objects within the Wick Engine.

Constructor

new Base()

Description:
  • Creates a Base object.

Source:

Members

classname :string

Description:
  • Returns the classname of a Wick Base object.

Source:

Returns the classname of a Wick Base object.

Type:
  • string

guiElement

Description:
  • The object that is used for rendering this object in the timeline GUI.

Source:

The object that is used for rendering this object in the timeline GUI.

identifier :string

Description:
  • The name of the object that is used to access the object through scripts. Must be a valid JS variable name.

Source:

The name of the object that is used to access the object through scripts. Must be a valid JS variable name.

Type:
  • string

isSelected :boolean

Description:
  • Check if an object is selected or not.

Source:

Check if an object is selected or not.

Type:
  • boolean

name :string

Description:
  • The name of the object.

Source:

The name of the object.

Type:
  • string

needsAutosave :boolean

Description:
  • Marks the object as possibly changed, so that next time autosave happens, this object is written to the save.

Source:

Marks the object as possibly changed, so that next time autosave happens, this object is written to the save.

Type:
  • boolean

parent :Wick.Base

Description:
  • The parent of this object.

Source:

The parent of this object.

Type:

parentClip :Wick.Clip

Description:
  • The parent Clip of this object.

Source:

The parent Clip of this object.

Type:

parentFrame :Wick.Frame

Description:
  • The parent Frame of this object.

Source:

The parent Frame of this object.

Type:

parentLayer :Wick.Layer

Description:
  • The parent Layer of this object.

Source:

The parent Layer of this object.

Type:

parentTimeline :Wick.Timeline

Description:
  • The parent Timeline of this object.

Source:

The parent Timeline of this object.

Type:

project :Wick.Project

Description:
  • The project that this object belongs to. Can be null if the object is not in a project.

Source:

The project that this object belongs to. Can be null if the object is not in a project.

Type:

removed :boolean

Description:
  • Signals if an object is removed from the project while playing. This is a temprary variable.

Source:

Signals if an object is removed from the project while playing. This is a temprary variable.

Type:
  • boolean

temporary

Description:
  • A marker if this object is temporary. Meaning it should be garbage collected after a play.

Source:

A marker if this object is temporary. Meaning it should be garbage collected after a play.

uuid :string

Description:
  • The uuid of a Wick Base object.

Source:

The uuid of a Wick Base object.

Type:
  • string

uuid

Description:
  • Changes an object's uuid. This function should not be used consistently, as it creates an entire copy of the object in the object cache. Avoid using this if possible.

Source:

Changes an object's uuid. This function should not be used consistently, as it creates an entire copy of the object in the object cache. Avoid using this if possible.

view

Description:
  • The Wick.View object that is used for rendering this object on the canvas.

Source:

The Wick.View object that is used for rendering this object on the canvas.

Methods

(static) fromData(data)

Source:
Parameters:
Name Type Description
data object

Serialized data to use to create a new object.

(static) import(exportData)

Description:
  • Import data created using Wick.Base.export().

Source:
Parameters:
Name Type Description
exportData object

an object created from Wick.Base.export().

addChild(child)

Description:
  • Add a child to this object.

Source:
Parameters:
Name Type Description
child Wick.Base

the child to add.

copy() → {Wick.Base}

Description:
  • Returns a copy of a Wick Base object.

Source:
Returns:

The object resulting from the copy

Type
Wick.Base

deserialize(data)

Description:
  • Parses serialized data representing Base Objects which have been serialized using the serialize function of their class.

Source:
Parameters:
Name Type Description
data object

Serialized data that was returned by a Base Object's serialize function.

export() → {object}

Description:
  • Returns an object containing serialied data of this object, as well as all of its children. Use this to copy entire Wick.Base objects between projects, and to export individual Clips as files.

Source:
Returns:

The exported data.

Type
object

getChild(classname)

Description:
  • Returns a single child of this object with a given classname.

Source:
Parameters:
Name Type Description
classname string

the classname to use

getChildren(classname)

Description:
  • Gets all children with a given classname(s).

Source:
Parameters:
Name Type Description
classname Array | string

(optional) A string, or list of strings, of classnames.

getChildrenRecursive()

Description:
  • Get an array of all children of this object, and the children of those children, recursively.

Source:

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

Description:
  • Assets attached to this object.

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

insertChild(child, index) → {boolean}

Description:
  • Insert a child into this at specified index.

    The insertion is performed as if there is a dummy object placed at index, then the child is moved one index past the dummy, then the dummy is deleted. Therefore if the child starts out inside this._children below index, then insertChild returns true and this._children.indexOf(child) == index - 1. Otherwise, returns false and this._children.indexOf(child) == index.

Source:
Parameters:
Name Type Description
child Wick.Base

the child to add.

index number

where to add the child

Returns:
  • true if an item before index was moved
Type
boolean

removeChild(child)

Description:
  • Remove a child from this object.

Source:
Parameters:
Name Type Description
child Wick.Base

the child to remove.

serialize() → {object}

Description:
  • Converts this Wick Base object into a plain javascript object contianing raw data (no references).

Source:
Returns:

Plain JavaScript object representing this Wick Base object.

Type
object