NormalizedRectangle

NormalizedRectangle

A PIXI.Rectangle where the width and height are always positive and the x and y are always the top-left

Constructor

new NormalizedRectangle()

Extends

  • PIXI.Rectangle

Methods

(static) fromRotation(x, y, width, height, radians) → {NormalizedRectangle}

Create normalized rectangular bounds given a rectangle shape and an angle of central rotation.

Parameters:
Name Type Description
x number

The top-left x-coordinate of the un-rotated rectangle

y number

The top-left y-coordinate of the un-rotated rectangle

width number

The width of the un-rotated rectangle

height number

The height of the un-rotated rectangle

radians number

The angle of rotation about the center

Returns:

The constructed rotated rectangle bounds

Type
NormalizedRectangle

intersects(other) → {boolean}

Determine whether some other Rectangle intersects with this one.

Parameters:
Name Type Description
other Rectangle

Some other rectangle against which to compare

Returns:

Do the rectangles intersect?

Type
boolean

rotate(radians) → {NormalizedRectangle}

Generate a new rectangle by rotating this one clockwise about its center by a certain number of radians

Parameters:
Name Type Description
radians number

The angle of rotation

Returns:

A new rotated rectangle

Type
NormalizedRectangle