Tuesday, 10 February 2015

How to change screen resolution in Adobe AIR [only Windows]

As you know we can't change resolution size using Adobe AIR. And that is a problem in old hardware where fill rate was low.

I got the answer to most of my problems:

With that tool you can change the screen resolution in windows using command line.

"QRes.exe /x:800 /y:600" for 800x600

The idea would be to have that EXE somewhere in the project folder.:
  1. On start, check current resolution and store it.
  2.  Call the other stored resolution we had stored it in options menu or wherever (can be also a fixed resolution of course).
  3.  We send as arguments to that executable and change the resolution to whatever we want (and it's supported by both GPU and screen).
  4.  Play the game / app.
  5.  Finally, on exit, restore the original resolution before closing the app.
That's a solution I am going to apply to my current game (Vortex Attack), needed for some of the old hardware I'm taking to the fairs... The problem will come whenever the app crashes or the user ALT-F4 (force quit) the app... Any ideas for that? Is there any event we can use for those two?