Module Rectangle-PIXI

class type _t = { ... }
type t = Js.t(_t);

Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its width and its height.

module Impl: { ... };
include Impl;
let create: ?⁠x:float => ?⁠y:float => ?⁠width:float => ?⁠height:float => unit => t;

creates new rectangle

parameter x

The X coordinate of the upper-left corner of the rectangle

parameter y

The Y coordinate of the upper-left corner of the rectangle

parameter width

The overall width of this rectangle

parameter heigth

The overall height of this rectangle

let empty: Js.t(_t);

A constant empty rectangle

let getBottom: Js.t(_t) => float;

the bottom edge of the rectangle

let getHeight: Js.t(_t) => float;

rectangle height

let setHeight: Js.t(_t) => float => unit;

rectangle height

let getLeft: Js.t(_t) => float;

the left edge of the rectangle

let getRight: Js.t(_t) => float;

the right edge of the rectangle

let getTop: Js.t(_t) => float;

the top edge of the rectangle

let _getType: Js.t(_t) => int;
let getType: Js.t(_t) => PIXI.SHAPES.t;

The type of the object, mainly used to avoid instanceof checks

let getWidth: Js.t(_t) => float;

rectangle width

let setWidth: Js.t(_t) => float => unit;

rectangle width

let getX: Js.t(_t) => float;

The X coordinate of the upper-left corner of the rectangle

let setX: Js.t(_t) => float => unit;

The X coordinate of the upper-left corner of the rectangle

let getY: Js.t(_t) => float;

The Y coordinate of the upper-left corner of the rectangle

let setY: Js.t(_t) => float => unit;

The Y coordinate of the upper-left corner of the rectangle

let ceil: Js.t(_t) => ?⁠resolution:float => ?⁠eps:float => unit => Js.t(_t);

Enlarges rectangle that way its corners lie on grid

parameter resolution

resolution

parameter eps

eps

returns

itself

let clone: Js.t(_t) => Js.t(_t);

Creates a clone of this Rectangle

returns

a copy of the rectangle

let contains: Js.t(_t) => x:float => y:float => bool;

Checks whether the x and y coordinates given are contained within this Rectangle

parameter x

The X coordinate of the point to test

parameter y

The Y coordinate of the point to test

returns

Whether the x/y coordinates are within this Rectangle

let copyFrom: Js.t(_t) => rectangle:Js.t(_t) => Js.t(_t);

Copies another rectangle to this one.

parameter rectangle

The rectangle to copy from.

returns

itself

let copyTo: Js.t(_t) => rectangle:Js.t(_t) => Js.t(_t);

Copies this rectangle to another one.

parameter The

rectangle to copy to

returns

returns updated rectangle that was passed as parameter

let enlarge: Js.t(_t) => rectangle:Js.t(_t) => Js.t(_t);

Enlarges this rectangle to include the passed rectangle

parameter rectangle

The rectangle to include

returns

itself

let fit: Js.t(_t) => rectangle:Js.t(_t) => Js.t(_t);

Fits this rectangle around the passed one

parameter rectangle

The rectangle to fit

returns

itself

let pad: Js.t(_t) => ?⁠paddingX:float => ?⁠paddingY:float => unit => Js.t(_t);

Pads the rectangle making it grow in all directions. If paddingY is omitted, both paddingX and paddingY will be set to paddingX.

parameter paddingX

The horizontal padding amount

parameter paddingY

The vertical padding amount

returns

itself