我们可以动态地改变舞台大小? [英] Can we change stage size dynamically?

查看:276
本文介绍了我们可以动态地改变舞台大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作就闪CS6和AIR 14.I开发一个应用程序,我想调整该应用程序的所有Android和iOS devices.for,我想改变我的舞台大小根据device.Is的屏幕分辨率动态有可能做that.if是怎么了?

Am working on flash cs6 and AIR 14.I developed one app i want to adjust that app to all android and ios devices.for that i want to change my stage size dynamically according to screen resolution of device.Is it possible to do that.if yes how ?

推荐答案

是的,这是可能的。

您需要做的第一件事是:(只要你的应用程序可以访问的阶段)

First thing you need to do is the following: (as soon as your application has access to the stage)

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align     = StageAlign.TOP_LEFT;

这会让你的舞台没有形成规模,并成为它的容器的全尺寸 - 你的情况AIR窗口。

This will make your stage not scale and become the full size of it's container - in your case an AIR window.

有关移动AIR,这将使该设备的屏幕分辨率。虽然在一些高密度显示器(iPhone),默认情况下,你可能会得到设备的一半的原始分辨率,但比例X2,因此它仍然是全屏。您可以调整这个当你如果需要在AIR构建应用程序。

For mobile AIR, this will make it the screen resolution of the device. Though on some high-density displays (iPhone) by default you may get half the native resolution of the device, but scaled x2 so it's still fullscreen. You can adjust this when you build the application in AIR if needed.

有关桌面AIR,您可以通过编程通过调整改变的阶段的NativeWindow

For desktop AIR, you can programmatically change the stage by resizing the NativeWindow.

stage.nativeWindow.width = 1234;  //set the width of the stage's window (which will in turn set the stage size if scaleMode is NO_SCALE)

这篇关于我们可以动态地改变舞台大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆