2
votes

I have written an air app which is fixed in dimensions: 1000 w X 800 h

I have set the resizable and maximizable tags of the app-xml to false, to prevent the user from changing its size.

This app looks and interacts perfectly at these dimensions but not at others: it has "bad" coding techniques in it like hard-coded display sizes and such, rtl and ltr combined layout directions and so forth...

When the applicationComplete event dispatches, I check Capabilities.screenResolutionY and if it is less than 800 I want to resize the app programmatically (preserving the width/height ratio).

I have tried all the StageScaleModes and tried changing the dimensions of the stage, the nativeWindow, the app itself("this") and so on in every combination.

I am looking for a way to resize the entire app as is, meaning I don't want to use display logic of the components and such, just to "shrink" or "expand" the whole app as is, with hard-coded pixel amounts to change within the logic of the app accordingly (change all sizes, locations, fonts etc.. in sync)

The app should look and work exactly as it did in its 1000x800 default size, only smaller or bigger.

2

2 Answers

3
votes

You may be able to do this using scaleX/scaleY, but it's not certain as some components may use these properties improperly. Other than that, your best bet is likely to rewrite the application to be scalable.

0
votes

well rewriting the app is the best bet obviously. meanwhile i was able to kind of do this with:

this.scaleX = this.scaleY = (some kind of ratio)
and disabling system chrome
and keeping nativeWindow's initial dimensions (100x800) intact

but it only works for shrinking purposes (ratio<1) . when u enlarge (ratio>1), the app gets "trimmed" by the nativeWindow's bounds and u cant change these bounds without changing in-app display logic