i have fullscreen proportional scaling bgrnd images...
but they re always centered.
i need the TopLeft or TopRight aligned. - but still fullscreen proportional scaling.
is there a way to do so?
i have this code so far, but its centered, so parts at the top get cutt off sometimes:
Code:onClipEvent(load){ // Assigning Vars for the middle of screen var middleX = Stage.width/2; var middleY = Stage.height/2; // Position the object in Middle this._x = middleX; this._y = middleY; // Scaling the background to fit // with the width & height of stage this._width = Stage.width; this._height = Stage.height; // Check if the image grew bigger horizontally or vertically // and adjust the other one to match with maintain aspectratio this._xscale > this._yscale ? this._yscale = this._xscale : this._xscale = this._yscale; // Assign this function to the object with same // actions everytime the Stage is resized // ============================================= Stage.addListener(this) this.onResize=function(){ // Assigning Vars for the middle of screen var middleX = Stage.width/2; var middleY = Stage.height/2; // Position the object in Middle this._x = middleX; this._y = middleY; // Scaling the background to fit // with the width & height of stage this._width = Stage.width; this._height = Stage.height; // Check if the image grew bigger horizontally or vertically // and adjust the other one to match with maintain aspectratio this._xscale > this._yscale ? this._yscale = this._xscale : this._xscale = this._yscale; } }




Reply With Quote