2013-04-18 13:16:18 +00:00
|
|
|
/// <reference path="../Game.ts" />
|
|
|
|
|
|
|
|
/**
|
2013-04-18 15:49:08 +00:00
|
|
|
* Phaser - IntersectResult
|
|
|
|
*
|
|
|
|
* A light-weight result object to hold the results of an intersection. For when you need more than just true/false.
|
|
|
|
*/
|
2013-04-18 13:16:18 +00:00
|
|
|
|
|
|
|
module Phaser {
|
|
|
|
|
|
|
|
export class IntersectResult {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Did they intersect or not?
|
|
|
|
* @property result
|
2013-05-11 16:26:30 +00:00
|
|
|
* @type {Boolean}
|
2013-04-18 13:16:18 +00:00
|
|
|
*/
|
|
|
|
result: bool = false;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @property x
|
2013-05-11 16:26:30 +00:00
|
|
|
* @type {Number}
|
2013-04-18 13:16:18 +00:00
|
|
|
*/
|
|
|
|
x: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @property y
|
2013-05-11 16:26:30 +00:00
|
|
|
* @type {Number}
|
2013-04-18 13:16:18 +00:00
|
|
|
*/
|
|
|
|
y: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @property x1
|
2013-05-11 16:26:30 +00:00
|
|
|
* @type {Number}
|
2013-04-18 13:16:18 +00:00
|
|
|
*/
|
|
|
|
x1: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @property y1
|
2013-05-11 16:26:30 +00:00
|
|
|
* @type {Number}
|
2013-04-18 13:16:18 +00:00
|
|
|
*/
|
|
|
|
y1: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @property x2
|
2013-05-11 16:26:30 +00:00
|
|
|
* @type {Number}
|
2013-04-18 13:16:18 +00:00
|
|
|
*/
|
|
|
|
x2: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @property y2
|
2013-05-11 16:26:30 +00:00
|
|
|
* @type {Number}
|
2013-04-18 13:16:18 +00:00
|
|
|
*/
|
|
|
|
y2: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @property width
|
2013-05-11 16:26:30 +00:00
|
|
|
* @type {Number}
|
2013-04-18 13:16:18 +00:00
|
|
|
*/
|
|
|
|
width: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @property height
|
2013-05-11 16:26:30 +00:00
|
|
|
* @type {Number}
|
2013-04-18 13:16:18 +00:00
|
|
|
*/
|
|
|
|
height: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @method setTo
|
|
|
|
* @param {Number} x1
|
|
|
|
* @param {Number} y1
|
|
|
|
* @param {Number} [x2]
|
|
|
|
* @param {Number} [y2]
|
|
|
|
* @param {Number} [width]
|
|
|
|
* @param {Number} [height]
|
|
|
|
*/
|
|
|
|
setTo(x1: number, y1: number, x2?: number = 0, y2?: number = 0, width?: number = 0, height?: number = 0) {
|
|
|
|
|
|
|
|
this.x = x1;
|
|
|
|
this.y = y1;
|
|
|
|
|
|
|
|
this.x1 = x1;
|
|
|
|
this.y1 = y1;
|
|
|
|
|
|
|
|
this.x2 = x2;
|
|
|
|
this.y2 = y2;
|
|
|
|
|
|
|
|
this.width = width;
|
|
|
|
this.height = height;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|