@spibo-studio/spibo-studio
Version:
Spibo Studio is an HTML Canvas Library for creating adventure games
30 lines • 992 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var CanvasRectangle = /** @class */ (function () {
function CanvasRectangle(width, height, position, action) {
this.width = width;
this.height = height;
this.position = position;
if (action)
this.action = action;
}
Object.defineProperty(CanvasRectangle.prototype, "pos", {
get: function () {
return this.position;
},
set: function (position) {
this.position = position;
},
enumerable: false,
configurable: true
});
CanvasRectangle.prototype.isInside = function (position) {
return (position.x > this.pos.x &&
position.x < this.pos.x + this.width &&
position.y > this.pos.y &&
position.y < this.pos.y + this.height);
};
return CanvasRectangle;
}());
exports.default = CanvasRectangle;
//# sourceMappingURL=CanvasRectangle.js.map