# src/pixi/Rectangle.js - Pixi.JS

#

API Docs for: 1.0.0
Show: Inherited Protected Private Deprecated

# File: src/pixi/Rectangle.js

    /**
     * @author Mat Groves http://matgroves.com/
     */

    /**
     * the 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.
     * @class Rectangle
     * @constructor
     * @param x {Number} position of the rectangle
     * @param y {Number} position of the rectangle
     * @param width {Number} of the rectangle
     * @param height {Number} of the rectangle
     */
    PIXI.Rectangle = function(x, y, width, height)
    {
    	/**
    	 * @property x
    	 * @type Number
    	 * @default 0
    	 */
    	this.x = x || 0;

    	/**
    	 * @property y
    	 * @type Number
    	 * @default 0
    	 */
    	this.y = y || 0;

    	/**
    	 * @property width
    	 * @type Number
    	 * @default 0
    	 */
    	this.width = width || 0;

    	/**
    	 * @property height
    	 * @type Number
    	 * @default 0
    	 */
    	this.height = height || 0;
    }

    /**
     * @method clone
     * @return a copy of the rectangle
     */
    PIXI.Rectangle.prototype.clone = function()
    {
    	return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
    }

    // constructor
    PIXI.Rectangle.constructor = PIXI.Rectangle;