Class/Object

io.scalajs.dom.html.phaser

Point

Related Docs: object Point | package phaser

Permalink

class Point extends Object

A Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis. The following code creates a point at (0,0):

var myPoint = new Phaser.Point();

You can also use them as 2D Vectors and you'll find different vector related methods in this class.

Annotations
@RawJSType() @native()
Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Point
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Point(x0: Double, y0: Double)

    Permalink

    x0

    The horizontal position of this Point.

    y0

    The vertical position of this Point.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def add(x: Double, y: Double): Point.this.type

    Permalink

    Adds the coordinates of two points together to create a new point.

    Adds the coordinates of two points together to create a new point.

    x

    The value to add to Point.x.

    y

    The value to add to Point.y.

    returns

    This Point object. Useful for chaining method calls.

  5. def angle(a: Any, asDegrees: Boolean): Point.this.type

    Permalink

    Returns the angle between this Point object and another object with public x and y properties.

    Returns the angle between this Point object and another object with public x and y properties.

    a

    The object to get the angle from this Point to.

    asDegrees

    Is the given angle in radians (false) or degrees (true)?

    returns

    The angle between the two objects.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def ceil(): Point.this.type

    Permalink

    Math.ceil() both the x and y properties of this Point.

    Math.ceil() both the x and y properties of this Point.

    returns

    This Point object.

  8. def clamp(min: Double, max: Double): Point.this.type

    Permalink

    Clamps this Point object values to be between the given min and max.

    Clamps this Point object values to be between the given min and max.

    min

    The minimum value to clamp this Point to.

    max

    The maximum value to clamp this Point to.

    returns

    This Point object.

  9. def clampX(min: Double, max: Double): Point.this.type

    Permalink

    Clamps the x value of this Point to be between the given min and max.

    Clamps the x value of this Point to be between the given min and max.

    min

    The minimum value to clamp this Point to.

    max

    The maximum value to clamp this Point to.

    returns

    This Point object.

  10. def clampY(min: Double, max: Double): Point.this.type

    Permalink

    Clamps the y value of this Point to be between the given min and max.

    Clamps the y value of this Point to be between the given min and max.

    min

    The minimum value to clamp this Point to.

    max

    The maximum value to clamp this Point to.

    returns

    This Point object.

  11. def clone(output: Point = null): Point

    Permalink

    Creates a copy of the given Point.

    Creates a copy of the given Point.

    output

    Optional Point object. If given the values will be set into this object, otherwise a brand new Point object will be created and returned.

    returns

    The new Point object.

  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def copyFrom(source: Any): Point.this.type

    Permalink

    Copies the x and y properties from any given object to this Point.

    Copies the x and y properties from any given object to this Point.

    source

    The object to copy from.

    returns

    This Point object.

  14. def copyTo(dest: Object): Object

    Permalink

    Copies the x and y properties from this Point to any given object.

    Copies the x and y properties from this Point to any given object.

    dest

    The object to copy to.

    returns

    The dest object.

  15. def cross(a: Point): Double

    Permalink

    The cross product of this and another Point object.

    The cross product of this and another Point object.

    a

    The Point object to get the cross product combined with

    returns

    The result.

  16. def distance(dest: Object, round: Boolean = false): Double

    Permalink

    Returns the distance of this Point object to the given object (can be a Circle, Point or anything with x/y properties)

    Returns the distance of this Point object to the given object (can be a Circle, Point or anything with x/y properties)

    dest

    The target object. Must have visible x and y properties that represent the center of the object.

    round

    Round the distance to the nearest integer (default false).

    returns

    The distance between this Point object and the destination Point object.

  17. def divide(x: Double, y: Double): Point.this.type

    Permalink

    Divides Point.x and Point.y by the given x and y values.

    Divides Point.x and Point.y by the given x and y values.

    x

    The value to divide Point.x by.

    y

    The value to divide Point.x by.

    returns

    This Point object. Useful for chaining method calls.

  18. def dot(a: Point): Double

    Permalink

    The dot product of this and another Point object.

    The dot product of this and another Point object.

    a

    The Point object to get the dot product combined with this Point.

    returns

    The result.

  19. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. def equals(a: Any): Boolean

    Permalink

    Determines whether the given objects x/y values are equal to this Point object.

    Determines whether the given objects x/y values are equal to this Point object.

    a

    The object to compare with this Point.

    returns

    A value of true if the x and y points are equal, otherwise false.

  21. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  22. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  23. def floor(): Point.this.type

    Permalink

    Math.floor() both the x and y properties of this Point.

    Math.floor() both the x and y properties of this Point.

    returns

    This Point object.

  24. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  25. def getMagnitude(): Double

    Permalink

    Calculates the length of the Point object.

    Calculates the length of the Point object.

    returns

    The length of the Point.

  26. def getMagnitudeSq(): Double

    Permalink

    Calculates the length squared of the Point object.

    Calculates the length squared of the Point object.

    returns

    The

    length ^ 2
  27. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  28. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  29. def invert(): Point.this.type

    Permalink

    Inverts the x and y values of this Point

    Inverts the x and y values of this Point

    returns

    This Point object.

  30. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  31. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  32. def isZero(): Boolean

    Permalink

    Determine if this point is at 0,0.

    Determine if this point is at 0,0.

    returns

    True if this Point is 0,0, otherwise false.

  33. def multiply(x: Double, y: Double): Point.this.type

    Permalink

    Multiplies Point.x and Point.y by the given x and y values.

    Multiplies Point.x and Point.y by the given x and y values. Sometimes known as Scale.

    x

    The value to multiply Point.x by.

    y

    The value to multiply Point.x by.

    returns

    This Point object. Useful for chaining method calls.

  34. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  35. def normalRightHand(): Point.this.type

    Permalink

    Right-hand normalize (make unit length) this Point.

    Right-hand normalize (make unit length) this Point.

    returns

    This Point object.

  36. def normalize(): Point.this.type

    Permalink

    Alters the Point object so that its length is 1, but it retains the same direction.

    Alters the Point object so that its length is 1, but it retains the same direction.

    returns

    This Point object.

  37. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  38. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  39. def perp(): Point.this.type

    Permalink

    Make this Point perpendicular (90 degrees rotation)

    Make this Point perpendicular (90 degrees rotation)

    returns

    This Point object.

  40. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  41. def rotate(x: Double, y: Double, angle: Double, asDegrees: Boolean, distance: Double): Point.this.type

    Permalink

    Rotates this Point around the x/y coordinates given to the desired angle.

    Rotates this Point around the x/y coordinates given to the desired angle.

    x

    The x coordinate of the anchor point.

    y

    The y coordinate of the anchor point.

    angle

    The angle in radians (unless asDegrees is true) to rotate the Point to.

    asDegrees

    Is the given angle in radians (false) or degrees (true)?

    distance

    An optional distance constraint between the Point and the anchor.

    returns

    The modified point object.

  42. def rperp(): Point.this.type

    Permalink

    Make this Point perpendicular (-90 degrees rotation)

    Make this Point perpendicular (-90 degrees rotation)

    returns

    This Point object.

  43. def set(x: Double, y: Double = js.native): Point.this.type

    Permalink

    Sets the x and y values of this Point object to the given values.

    Sets the x and y values of this Point object to the given values. If you omit the y value then the x value will be applied to both, for example: Point.set(2) is the same as Point.set(2, 2)

    x

    The horizontal value of this point.

    y

    The vertical value of this point. If not given the x value will be used in its place.

    returns

    This Point object. Useful for chaining method calls.

  44. def setMagnitude(magnitude: Double): Point.this.type

    Permalink

    Alters the length of the Point without changing the direction.

    Alters the length of the Point without changing the direction.

    magnitude

    The desired magnitude of the resulting Point.

    returns

    This Point object.

  45. def setTo(x: Double, y: Double = js.native): Point.this.type

    Permalink

    Sets the x and y values of this Point object to the given values.

    Sets the x and y values of this Point object to the given values. If you omit the y value then the x value will be applied to both, for example: Point.setTo(2) is the same as Point.setTo(2, 2)

    x

    The horizontal value of this point.

    y

    Optional: The vertical value of this point. If not given the x value will be used in its place.

    returns

    This Point object. Useful for chaining method calls.

  46. def subtract(x: Double, y: Double): Point.this.type

    Permalink

    Subtracts the given x and y values from this Point.

    Subtracts the given x and y values from this Point.

    x

    The value to subtract from Point.x.

    y

    The value to subtract from Point.y.

    returns

    This Point object. Useful for chaining method calls.

  47. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  48. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  49. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  50. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  51. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. var x: Double

    Permalink
  55. var y: Double

    Permalink

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped