Wrong stage size on MBP Retina


hi, i'm not sure if it's bug or i'm doing wrong, don't right stage bounds on macbook pro retina.

 

i set <requesteddisplayresolution>high</requesteddisplayresolution> inside the  initialwindow tag, stage.fullscreenwidth returns 1440 instead of 2880 , stage.stagewidth returns wrong values also.

 

i made tests air sdks 3.7, 3.8, 3.9 , 4.0, no 1 worked me.
am overlooking something?

 

here's code i'm using:

package {      import flash.display.sprite;      import flash.display.stagealign;      import flash.display.stagescalemode;      import flash.events.event;      import flash.text.textfield;      import flash.text.textformat;       public class test extends sprite      {           private var console : textfield;           public function test()           {                stage.scalemode = stagescalemode.no_scale;                stage.align = stagealign.top_left;                stage.addeventlistener(event.resize, onstageresize);                                console = new textfield();                console.defaulttextformat = new textformat("_sans", 12);                console.width = stage.stagewidth;                console.height = stage.stageheight;                console.wordwrap = true;                console.multiline = true;                addchild(console);           }            private function onstageresize(event : event) : void           {                output("***********************************************");                output('stage.contentsscalefactor: ' + (stage.contentsscalefactor));                output('stage.stagewidth: ' + (stage.stagewidth));                output('stage.stageheight: ' + (stage.stageheight));                output('stage.fullscreenwidth: ' + (stage.fullscreenwidth));                output('stage.fullscreenheight: ' + (stage.fullscreenheight));                                console.width = stage.stagewidth;                console.height = stage.stageheight;           }            private function output(... $text) : void           {                var text:string = $text.join(", ");                console.appendtext(text+"\n");                trace(text);           }      } } 

 

 

thanks in advance,
solano

i believe expected behavior on native stage. when running on retina device requesteddisplayresolution set high, native stage uses same coordinate system non-retina version, , stagewidth , stageheight reported same units, mentioned in docs contentsscalefactor:

http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/flash/display/stage.htm l#contentsscalefactor

 

you query value of contentsscalefactor know if running in retina mode or not.

 

the native stage coordinates stay same, if using stage3d in app, higher res buffer created additonal argument configurebackbuffer():

http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/flash/display3d/context 3d.html#configurebackbuffer%28%29

and in case raw pixel dimensions double in size.



More discussions in AIR Development


adobe

Comments

Popular posts from this blog

Could not place because the source rectangle is empty

Thread: Using smartcard reader with vpnc

Adobe Font Folio 7.0 or just 7?