diff --git a/bin/pixi.dev.js b/bin/pixi.dev.js index d5fcfee..7862f57 100644 --- a/bin/pixi.dev.js +++ b/bin/pixi.dev.js @@ -870,6 +870,8 @@ * */ this._bounds = new PIXI.Rectangle(0, 0, 1, 1); + + this._currentBounds = null; /* * MOUSE Callbacks @@ -1321,6 +1323,38 @@ PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer; /** + * The width of the sprite, setting this will actually modify the scale to acheive the value set + * + * @property width + * @type Number + */ +Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', { + get: function() { + return this.scale.x * this.getBounds().width; + }, + set: function(value) { + this.scale.x = value / (this.getBounds().width/this.scale.x); + this._width = value; + } +}); + +/** + * The height of the sprite, setting this will actually modify the scale to acheive the value set + * + * @property height + * @type Number + */ +Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', { + get: function() { + return this.scale.y * this.getBounds().height; + }, + set: function(value) { + this.scale.y = value / (this.getBounds().height/this.scale.y); + this._height = value; + } +}); + +/** * Adds a child to the container. * * @method addChild @@ -1448,6 +1482,8 @@ { if(!this.visible)return; + this._currentBounds = null; + PIXI.DisplayObject.prototype.updateTransform.call( this ); for(var i=0,j=this.children.length; i