# Two.Anchor

Extends: Two.Vector

An object that holds 3 Two.Vectors, the anchor point and its corresponding handles: left and right. In order to properly describe the bezier curve about the point there is also a command property to describe what type of drawing should occur when Two.js renders the anchors.

# Constructor

Argument Description
x The x position of the root anchor point.
y The y position of the root anchor point.
lx The x position of the left handle point.
ly The y position of the left handle point.
rx The x position of the right handle point.
ry The y position of the right handle point.
command The command to describe how to render. Applicable commands are Two.Commands

# copy

Argument Description
v The anchor to apply values to.

Copy the properties of one Two.Anchor onto another.

# clone

Returns: Two.Anchor

Create a new Two.Anchor, set all its values to the current instance and return it for use.

# toObject

Returns: Object

  • An object with properties filled out to mirror Two.Anchor.

Create a JSON compatible plain object of the current instance. Intended for use with storing values in a database.

# toString

Returns: String

  • A String with comma-separated values reflecting the various values on the current instance.

Create a string form of the current instance. Intended for use with storing values in a database. This is lighter to store than the JSON compatible Two.Anchor.toObject.