AS3 - Fullscreen that uses full browser window

半城伤御伤魂 提交于 2019-12-11 23:58:39

问题


My flash program isn't using the full browser window, even while in full-screen mode. It uses the full height but not the full width. I end up with a large chunk of white space. I have the following code for full-screen mode:

function fullscreenOnClick(e:MouseEvent):void
{
      stage.align = StageAlign.TOP_LEFT
      stage.displayState = StageDisplayState.FULL_SCREEN;
}

I also have some code to set the background color:

//set the background
graphics.beginFill(0x777777);
graphics.drawRect( 0, 0, stage.stageWidth, stage.stageHeight);
graphics.endFill();

So the problem is that the stage's width isn't the full size of the browser. I'm using Flash Builder 4.6 is there a way to set the stage's parameters to allow for true full-screen?


回答1:


It must be because of the scaling mode. Try changing the stage's scaleMode to StageScaleMode.NO_BORDER, (or experiment with the other scale modes if StageScaleMode.NO_BORDER is not what you are looking for.)



来源:https://stackoverflow.com/questions/9318179/as3-fullscreen-that-uses-full-browser-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!