PIXI.DisplayObject = function (){ this.position = new PIXI.Point(); this.scale = new PIXI.Point(1, 1); this.pivot = new PIXI.Point(0, 0); this.rotation = 0; this.alpha = 1; this.visible = true ; this.hitArea = null ; this.buttonMode = false ; this.renderable = false ; this.parent = null ; this.stage = null ; this.worldAlpha = 1; this._interactive = false ; this.defaultCursor = 'pointer'; this.worldTransform = new PIXI.Matrix(); this.color = [] ; this.dynamic = true ; this._sr = 0; this._cr = 1; this.filterArea = new PIXI.Rectangle(0, 0, 1, 1); this._bounds = new PIXI.Rectangle(0, 0, 1, 1); this._currentBounds = null ; this._mask = null ; } ; PIXI.DisplayObject.prototype.constructor = PIXI.DisplayObject; PIXI.DisplayObject.prototype.setInteractive = function (interactive){ this.interactive = interactive; } ; Object.defineProperty(PIXI.DisplayObject.prototype, 'interactive', { get: function (){ return this._interactive; } , set: function (value){ this._interactive = value; if (this.stage) this.stage.dirty = true ; } } ); Object.defineProperty(PIXI.DisplayObject.prototype, 'worldVisible', { get: function (){ var item = this; do { if (!item.visible) return false ; item = item.parent; } while(item)return true ; } } ); Object.defineProperty(PIXI.DisplayObject.prototype, 'mask', { get: function (){ return this._mask; } , set: function (value){ if (this._mask) this._mask.isMask = false ; this._mask = value; if (this._mask) this._mask.isMask = true ; } } ); Object.defineProperty(PIXI.DisplayObject.prototype, 'filters', { get: function (){ return this._filters; } , set: function (value){ if (value) { var passes = [] ; for (var i = 0; i < _AN_Read_length('length', value); i++ ){ var filterPasses = value[i].passes; for (var j = 0; j < _AN_Read_length('length', filterPasses); j++ ){ passes.push(filterPasses[j]); } } this._filterBlock = { target: this, filterPasses: passes} ; } this._filters = value; } } ); PIXI.DisplayObject.prototype.updateTransform = function (){ if (this.rotation !== this.rotationCache) { this.rotationCache = this.rotation; this._sr = Math.sin(this.rotation); this._cr = Math.cos(this.rotation); } var parentTransform = this.parent.worldTransform; var worldTransform = this.worldTransform; var px = this.pivot.x; var py = this.pivot.y; var a00 = this._cr * this.scale.x, a01 = - this._sr * this.scale.y, a10 = this._sr * this.scale.x, a11 = this._cr * this.scale.y, a02 = this.position.x - a00 * px - py * a01, a12 = this.position.y - a11 * py - px * a10, b00 = parentTransform.a, b01 = parentTransform.b, b10 = parentTransform.c, b11 = parentTransform.d; worldTransform.a = b00 * a00 + b01 * a10; worldTransform.b = b00 * a01 + b01 * a11; worldTransform.tx = b00 * a02 + b01 * a12 + parentTransform.tx; worldTransform.c = b10 * a00 + b11 * a10; worldTransform.d = b10 * a01 + b11 * a11; worldTransform.ty = b10 * a02 + b11 * a12 + parentTransform.ty; this.worldAlpha = this.alpha * this.parent.worldAlpha; } ; PIXI.DisplayObject.prototype.getBounds = function (matrix){ matrix = matrix; return PIXI.EmptyRectangle; } ; PIXI.DisplayObject.prototype.getLocalBounds = function (){ return this.getBounds(PIXI.identityMatrix); } ; PIXI.DisplayObject.prototype.setStageReference = function (stage){ this.stage = stage; if (this._interactive) this.stage.dirty = true ; } ; PIXI.DisplayObject.prototype._renderWebGL = function (renderSession){ renderSession = renderSession; } ; PIXI.DisplayObject.prototype._renderCanvas = function (renderSession){ renderSession = renderSession; } ; Object.defineProperty(PIXI.DisplayObject.prototype, 'x', { get: function (){ return this.position.x; } , set: function (value){ this.position.x = value; } } ); Object.defineProperty(PIXI.DisplayObject.prototype, 'y', { get: function (){ return this.position.y; } , set: function (value){ this.position.y = value; } } );