#region File Description
//-----------------------------------------------------------------------------
// Game.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion
#region Using Statements
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MonoMac.Foundation;
using MonoMac.AppKit;
using MonoMac.ObjCRuntime;
#endregion
namespace GameStateManagement
{
///
/// Sample showing how to manage different game states, with transitions
/// between menu screens, a loading screen, the game itself, and a pause
/// menu. This main game class is extremely simple: all the interesting
/// stuff happens in the ScreenManager component.
///
public class GameStateManagementGame : Microsoft.Xna.Framework.Game
{
#region Fields
GraphicsDeviceManager graphics;
ScreenManager screenManager;
// By preloading any assets used by UI rendering, we avoid framerate glitches
// when they suddenly need to be loaded in the middle of a menu transition.
static readonly string[] preloadAssets =
{
"gradient",
};
#endregion
#region Initialization
///
/// The main game constructor.
///
public GameStateManagementGame ()
{
Content.RootDirectory = "Content";
graphics = new GraphicsDeviceManager (this);
graphics.PreferredBackBufferWidth = 853;
graphics.PreferredBackBufferHeight = 480;
// Create the screen manager component.
screenManager = new ScreenManager (this);
Components.Add (screenManager);
// Activate the first screens.
screenManager.AddScreen (new BackgroundScreen (), null);
screenManager.AddScreen (new MainMenuScreen (), null);
}
///
/// Loads graphics content.
///
protected override void LoadContent ()
{
foreach (string asset in preloadAssets) {
Content.Load