API Documentation for: 1.0.0
Show:

Point Class

Defined in: Point:41
Module: EaselJS

Represents a point on a 2 dimensional x / y coordinate system.

Example

 var point = new createjs.Point(0, 100);

Constructor

Point

(
  • [x=0]
  • [y=0]
)

Defined in Point:41

Parameters:

  • [x=0] Number optional

    X position.

  • [y=0] Number optional

    Y position.

Item Index

Properties

Methods

clone

() Point

Defined in clone:166

Returns a clone of the Point instance.

Returns:

Point:

a clone of the Point instance.

copy

(
  • point
)
Point chainable

Defined in copy:153

Copies all properties from the specified point to this point.

Parameters:

  • point Point

    The point to copy properties from.

Returns:

Point:

This point. Useful for chaining method calls.

interpolate

(
  • pt1
  • pt2
  • f
  • [pt]
)
Point static

Defined in interpolate:125

Determine a point between two specified points.

The parameter f determines where the new interpolated point is located relative to the two end points specified by parameters pt1 and pt2:

  • The closer the value of the parameter f is to 1.0, the closer the interpolated point is to the first point (parameter pt1).
  • The closer the value of the parameter f is to 0, the closer the interpolated point is to the second point (parameter pt2).

Parameters:

  • pt1 Point | Object

    The first point as a Point or generic object.

  • pt2 Point | Object

    The second point as a Point or generic object.

  • f Number

    The level of interpolation between the two points. Indicates where the new point will be, along the line between pt1 and pt2. If f=1, pt1 is returned; if f=0, pt2 is returned.

  • [pt] Point | Object optional

    An object to copy the result into. If omitted, a new Point will be returned.

Returns:

Point:

A new interpolated Point, or the pt passed in the 4th parameter with the interpolated values.

offset

(
  • dx
  • dy
)
Point chainable

Defined in offset:90

Offsets the Point object by the specified amount.

  • The value of dx is added to the original value of x to create the new x value
  • The value of dy is added to the original value of y to create the new y value

Parameters:

  • dx Number

    The amount by which to offset the horizontal coordinate, x.

  • dy Number

    The amount by which to offset the vertical coordinate, y.

Returns:

Point:

This instance. Useful for chaining method calls.

polar

(
  • len
  • angle
  • [pt]
)
Point static

Defined in polar:108

Converts a pair of polar coordinates to a Cartesian point coordinate.

Parameters:

  • len Number

    The length coordinate of the polar pair.

  • angle Number

    The angle, in radians, of the polar pair.

  • [pt] Point | Object optional

    An object to copy the result into. If omitted a new Point will be returned.

Returns:

Point:

The new, interpolated point.

setValues

(
  • [x=0]
  • [y=0]
)
Point chainable

Defined in setValues:76

Sets the specified values on this instance.

Parameters:

  • [x=0] Number optional

    X position.

  • [y=0] Number optional

    Y position.

Returns:

Point:

This instance. Useful for chaining method calls.

toString

() String

Defined in toString:175

Returns a string representation of this object.

Returns:

String:

a string representation of the instance.

Properties

x

Number

Defined in x:59

X position.

Default: 0

y

Number

Defined in y:66

Y position.

Default: 0