全屏居中 AIR 应用程序
我有一个在 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>
启动时,应用程序进入全屏,模块加载器加载模块/swfs
大小为 1024*768,但当前所有加载的模块都对齐到 x=0 且 y=0。
有什么想法吗?
谢谢大家。
I have a application developed in AIR /AS 3.0..
i want to run the application in full screen with all the content centered in the window.
i tried to do fullscreen with
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE
but turned out all my components dont get centered on the screen as needed(when in full screen) and they get cutoff or they are off screen.
Basically the application was developed in lower resolution about 1024x768...but now it needs to run full screen.Also the application loads various modules at runtime they also dont appear to be centered in fullscreen.When the application comes out of fullscreen it also shows scrollbars for the application window..
Edit :Code added :
<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>
On start, the Application goes fullscreen,and the module loader loads modules/swfs
that are of size 1024*768 ,but currently all loaded modules get aligned to
x=0 and y=0.
Any ideas?
Thanks all.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将所有显示对象布局在显示对象容器中 - 作为新精灵的子级,并侦听全屏事件以使显示对象容器居中。
请注意,进入和离开全屏模式时都会调度全屏事件。
layout all of your display objects in a display object container - as children of a new sprite, and listen for a full screen event to center the display object container.
note that the full screen event is dispatched when both entering and leaving full screen mode.