Lock Resolution

Is it possible to lock a game at a set resolution and prevent the user from resizing the window or switching fullscreen? Fullscreen wouldn't be a problem except that if you switch to fullscreen and back, Mac OS X retains the monitor's native resolution in the new window size regardless of its size prior to fullscreen.

Another solution might be to allow fullscreen, but return the window to the preferred size on minimizingthis would require an `onFullscreen()` callback (or something like it).

Much help would be appreciated!

`Screen.fullScreen` is a `bool` property that can be read or set. You can use this to determine if the player has just left fullscreen and switch to a different resolution.

example:

private var wasFullScreen : Boolean = false;

function Update () {
    if (wasFullScreen && !Screen.fullScreen) {
        // this gets executed once right after leaving full screen
    }
    if (!wasFullScreen && Screen.fullScreen) {
        // this gets executed once right after entering full screen
    }
    wasFullScreen = Screen.fullScreen;
}


edit:

If you're building for the web player you can disable the right click menu so people can't go fullscreen to begin with.

To get to the setting go to File > Build Settings, then choose Player Settings and select No Context Menu for the Web Player Template.

alt text