Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Air 全屏定心空气应用_Air_Adobe_Fullscreen_Centering - Fatal编程技术网

Air 全屏定心空气应用

Air 全屏定心空气应用,air,adobe,fullscreen,centering,Air,Adobe,Fullscreen,Centering,我在AIR/AS 3.0中开发了一个应用程序。 我想全屏运行应用程序,所有内容都集中在窗口中。 我试着用电脑全屏显示 stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE 但事实证明,我所有的组件都没有根据需要在屏幕上居中(当全屏显示时),它们会被切断或脱离屏幕。 基本上,该应用程序是以较低的分辨率开发的,分辨率约为1024x768…但现在它需要全屏运行。此外,该应用程序在运行时加载各种模块,它们也不会以全屏为中心。当


我在AIR/AS 3.0中开发了一个应用程序。
我想全屏运行应用程序,所有内容都集中在窗口中。 我试着用电脑全屏显示

stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE  
但事实证明,我所有的组件都没有根据需要在屏幕上居中(当全屏显示时),它们会被切断或脱离屏幕。 基本上,该应用程序是以较低的分辨率开发的,分辨率约为1024x768…但现在它需要全屏运行。此外,该应用程序在运行时加载各种模块,它们也不会以全屏为中心。当应用程序从全屏中出来时,它还显示应用程序窗口的滚动条

编辑:添加代码:

<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
          layout="absolute" width="1024" height="768">

     <Application:ApplicationStartContainer id="aps" width="100%" height="100%">

               <mx:ModuleLoader id="moduleLoader"/>    

     </Application:ApplicationStartContainer>            

</mx:WindowedApplication>

启动时,应用程序全屏显示,模块加载器加载模块/SWF
大小为1024*768,但当前所有加载的模块都与 x=0,y=0

有什么想法吗


谢谢大家

在显示对象容器中布局所有显示对象-作为新精灵的子对象,并侦听全屏事件以使显示对象容器居中

stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullScreenEventHandler);

//assuming the registration point of 'container' is top-left
function fullScreenEventHandler(evt:FullScreenEvent):void
     {
     container.x = stage.stageWidth / 2 - container.width / 2;
     container.y = stage.stageHeight / 2 - container.height / 2;
     }

请注意,在进入和离开全屏模式时,都会调度全屏事件。

基本上,容器有一个加载各种模块的模块加载器。我希望加载的模块位于应用程序的中心。每当屏幕全屏显示时,模块加载器都会固定在左上角(x=0和y=0)模块的大小与容器的大小相同。1024乘768右,因此使用相同的方法将模块装入器而不是容器居中。moduleLoader.x=stage.stageWidth/-moduleLoader.width/2;,等