UNPKG

@phaserjs/phaser

Version:
11 lines (10 loc) 423 B
/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ import { Vec2 } from "../../math/vec2/Vec2"; export function DecomposeRectangle(rect, out = []) { out.push(new Vec2(rect.x, rect.y), new Vec2(rect.right, rect.y), new Vec2(rect.right, rect.bottom), new Vec2(rect.x, rect.bottom)); return out; }