/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { //Initialize Uielements var newBaseGame = new BaseGame(); var newSideMenu = new SideMenu(); newBaseGame.Initialize(GraphicsDevice, new ContentManager(Content.ServiceProvider, Content.RootDirectory)); newSideMenu.Initialize(GraphicsDevice, new ContentManager(Content.ServiceProvider, Content.RootDirectory), newBaseGame); _uiElements.Add(newBaseGame); _uiElements.Add(newSideMenu); //Set width and Height of application _graphicsDeviceManager.PreferredBackBufferHeight = newBaseGame.CellCountY * newBaseGame.CellSize + 1; _graphicsDeviceManager.PreferredBackBufferWidth = newBaseGame.CellCountX * newBaseGame.CellSize + 1 + 250; _graphicsDeviceManager.ApplyChanges(); //Set mouse visibility to true IsMouseVisible = true; base.Initialize(); }