Options
All
  • Public
  • Public/Protected
  • All
Menu

The Point object represents a location in a two-dimensional coordinate system, where x represents the position on the horizontal axis and y represents the position on the vertical axis

memberof

PIXI

implements

IPoint

Hierarchy

  • Point

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Point(x?: number, y?: number): Point
  • Creates a new Point

    Parameters

    • Optional x: number
    • Optional y: number

    Returns Point

Properties

x

x: number

Position of the point on the x axis

y

y: number

Position of the point on the y axis

Methods

clone

  • Creates a clone of this point

    Returns Point

    A clone of this point

copyFrom

  • Copies x and y from the given point into this point

    Parameters

    Returns Point

    The point instance itself

copyTo

  • copyTo<T>(p: T): T
  • Copies this point's x and y into the given point (p).

    Type parameters

    Parameters

    • p: T

      The point to copy to. Can be any of type that is or extends IPointData

    Returns T

    The point (p) with values updated

equals

  • Accepts another point (p) and returns true if the given point is equal to this point

    Parameters

    Returns boolean

    Returns true if both x and y are equal

set

  • set(x?: number, y?: number): Point
  • Sets the point to a new x and y position. If y is omitted, both x and y will be set to x.

    Parameters

    • Optional x: number
    • Optional y: number

    Returns Point

    The point instance itself

toString

  • toString(): string
  • Returns string

Generated using TypeDoc