ResolutionRrOrientationChanged
Introduction
The ResolutionOrOrientationChanged event is an event which is raised whenever the game's resolution or orientation changes. This can happen if:
The orientation changes (on a mobile or tablet)
The user docks your game in Windows 8
The user changes the window resolution - either through a command in the game or by resizing the window
Code Example
This example assumes a desktop application. It will allow the user to resize a window by dragging the corner/edges. Whenever the user does this the new resolution will be printed to the screen. First, add the following code to your Screen's CustomInitialize:
To add the ResolutionOrOrientationChanged event:
Open or focus on Glue
Right-click on your Screen's Events item
Select "Add Event"
Verify "Expose an existing event" is selected
Use the drop-down to select "ResolutionOrOrientationChanged"
Click OK
Next, go back to Visual Studio and open your screen's Event file. If your screen is called "GameScreen" then the event file will be "GameScreen.Event.cs". Add the following code to OnResolutionOrOrientationChanged:
Last updated