Rectangle#offsetPoint()

offsetPoint(point) → {Phaser.Rectangle} Adjusts the location of the Rectangle object using a Point object as a parameter. This method is similar to the Rectangle.offset() method, except that it takes a Point object as a parameter. Parameters Name Type Description point Phaser.Point A Point object to use to offset this Rectangle object. Returns Phaser.Rectangle - This Rectangle object. Source code: geom/Rectangle.js (Line 71)

Rectangle#perimeter

[readonly] perimeter : number The perimeter size of the Rectangle. This is the sum of all 4 sides. Source code: geom/Rectangle.js (Line 597)

Rectangle#random()

random(out) → {Phaser.Point} Returns a uniformly distributed random point from anywhere within this Rectangle. Parameters Name Type Argument Description out Phaser.Point | object <optional> A Phaser.Point, or any object with public x/y properties, that the values will be set in. If no object is provided a new Phaser.Point object will be created. In high performance areas avoid this by re-using an existing object. Returns Phaser.Point - An object containing the random point in

Rectangle#randomX

randomX : number A random value between the left and right values (inclusive) of the Rectangle. Source code: geom/Rectangle.js (Line 645)

Rectangle#randomY

randomY : number A random value between the top and bottom values (inclusive) of the Rectangle. Source code: geom/Rectangle.js (Line 661)

Rectangle#Rectangle

new Rectangle(x, y, width, height) Creates a new Rectangle object with the top-left corner specified by the x and y parameters and with the specified width and height parameters.If you call this function without parameters, a Rectangle with x, y, width, and height properties set to 0 is created. Parameters Name Type Description x number The x coordinate of the top-left corner of the Rectangle. y number The y coordinate of the top-left corner of the Rectangle. width number The width of

Rectangle#resize()

resize(width, height) → {Phaser.Rectangle} Resize the Rectangle by providing a new width and height.The x and y positions remain unchanged. Parameters Name Type Description width number The width of the Rectangle. Should always be either zero or a positive value. height number The height of the Rectangle. Should always be either zero or a positive value. Returns Phaser.Rectangle - This Rectangle object Source code: geom/Rectangle.js (Line 241)

Rectangle#right

right : number The sum of the x and width properties. Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. Source code: geom/Rectangle.js (Line 562)

Rectangle#scale()

scale(x, y) → {Phaser.Rectangle} Scales the width and height of this Rectangle by the given amounts. Parameters Name Type Argument Description x number The amount to scale the width of the Rectangle by. A value of 0.5 would reduce by half, a value of 2 would double the width, etc. y number <optional> The amount to scale the height of the Rectangle by. A value of 0.5 would reduce by half, a value of 2 would double the height, etc. Returns Phaser.Rectangle - This Rectangle o

Rectangle#setTo()

setTo(x, y, width, height) → {Phaser.Rectangle} Sets the members of Rectangle to the specified values. Parameters Name Type Description x number The x coordinate of the top-left corner of the Rectangle. y number The y coordinate of the top-left corner of the Rectangle. width number The width of the Rectangle. Should always be either zero or a positive value. height number The height of the Rectangle. Should always be either zero or a positive value. Returns Phaser.Rectangle - T