Point#setTo()

setTo(x, y) → {Phaser.Point} 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) Parameters Name Type Argument Description x number The horizontal value of this point. y number <optional> The vertical value of this point. If not given the x value will be used in its place. Returns Phaser.Point - This Point object. Useful for chaining me

Point#setMagnitude()

setMagnitude(magnitude) → {Phaser.Point} Alters the length of the Point without changing the direction. Parameters Name Type Description magnitude number The desired magnitude of the resulting Point. Returns Phaser.Point - This Point object. Source code: geom/Point.js (Line 345)

Point#set()

set(x, y) → {Phaser.Point} 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) Parameters Name Type Argument Description x number The horizontal value of this point. y number <optional> The vertical value of this point. If not given the x value will be used in its place. Returns Phaser.Point - This Point object. Useful for chaining method c

Point#rperp()

rperp() → {Phaser.Point} Make this Point perpendicular (-90 degrees rotation) Returns Phaser.Point - This Point object. Source code: geom/Point.js (Line 427)

Point#rotate()

rotate(x, y, angle, asDegrees, distance) → {Phaser.Point} Rotates this Point around the x/y coordinates given to the desired angle. Parameters Name Type Argument Default Description x number The x coordinate of the anchor point. y number The y coordinate of the anchor point. angle number The angle in radians (unless asDegrees is true) to rotate the Point to. asDegrees boolean <optional> false Is the given angle in radians (false) or degrees (true)? distance numb

Point#Point

new Point(x, y) 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. Parameters Name Type Argument Default Description x number <optional> 0 The horizontal position of this Point. y number <optional>

Point#perp()

perp() → {Phaser.Point} Make this Point perpendicular (90 degrees rotation) Returns Phaser.Point - This Point object. Source code: geom/Point.js (Line 415)

Point#normalRightHand()

normalRightHand() → {Phaser.Point} Right-hand normalize (make unit length) this Point. Returns Phaser.Point - This Point object. Source code: geom/Point.js (Line 439)

Point#normalize()

normalize() → {Phaser.Point} Alters the Point object so that its length is 1, but it retains the same direction. Returns Phaser.Point - This Point object. Source code: geom/Point.js (Line 358)

Point#multiply()

multiply(x, y) → {Phaser.Point} Multiplies Point.x and Point.y by the given x and y values. Sometimes known as Scale. Parameters Name Type Description x number The value to multiply Point.x by. y number The value to multiply Point.x by. Returns Phaser.Point - This Point object. Useful for chaining method calls. Source code: geom/Point.js (Line 138)