Main Menu GUI

I shifted focus to the main menu UI today. As I mentioned yesterday, I'm thinking of setting up an "Options" button on the main menu, and moving all the graphics and audio options onto that page. I think it'll simplify the main screen, and also gives me a chance to put the "Options" button dead-center, in case something happens causing the game to zoom in too much for the screen. (E.g. a "reset" button to restore 800x450 mode if the player can't see anything).

While I was working on this screen, I realized that I might be able to set it up to auto-choose resolution/layout based on window size. It sort of does that now, but has a tendency to flake out and only choose smaller resolutions, forcing the user to reselect bigger resolutions. However, I think I can make it automatically choose the largest resolution that will fit in the current window.

I setup some code to do this, and it actually seemed to work pretty well. It even seemed to choose the 1024x768 (4:3 aspect ratio) mode at appropriate times, and widescreen modes for the rest. I could resize the window, maximize it, and do whatever, and the layout always seemed to adjust in a reasonable way.

There were still black bars on the top and sides if the window wasn't a perfect fit, so I experimented with stretching to fit by default. This worked too, but I think the scaling looks pretty ugly. So I may revert to black bars by default.

In addition to this auto-scaling, I want to see if I can include buttons to "manually override" what the game chooses. So if you know you want stretch, or filter, or a specific layout, you can still choose it, and it'll override what the game chose (and remember it for next time). (E.g. 4:3 ratio, or buttons on both sides instead of just along the left)

With any luck, we can make it choose something more appropriate by default than it does currently, but still offer freedom for tweaking. I'll also be looking into the issues of it forgetting "fullscreen" settings between sessions, and the "Esc" button exiting fullscreen. Unfortunately, I suspect Flash hard-wires the app to do this (to prevent malicious apps from covering the desktop and capturing keypresses), but I'll still take a look.

Hope everyone has a good night!