/// <summary> /// * Code for fullscreen / windowed toggle /// </summary> private void GlobalActivity() { if (InputManager.Keyboard.IsAltDown && InputManager.Keyboard.KeyPushed(Keys.Enter)) { if (CameraSetup.Data.IsFullScreen) { CameraSetup.Data.IsFullScreen = false; CameraSetup.Data.AllowWidowResizing = true; var xnaWindow = FlatRedBall.FlatRedBallServices.Game.Window; xnaWindow.AllowUserResizing = true; //xnaWindow.IsBorderless = false; WinApi.UnsetWindowAlwaysOnTop(this.Window.Handle); CameraSetup.ResetWindow(); } else { CameraSetup.Data.IsFullScreen = true; CameraSetup.Data.AllowWidowResizing = false; var xnaWindow = FlatRedBall.FlatRedBallServices.Game.Window; xnaWindow.AllowUserResizing = false; //xnaWindow.IsBorderless = true; // This for some reason breaks the OnTop behaviour. MG bug ? WinApi.SetWindowAlwaysOnTop(this.Window.Handle); CameraSetup.ResetWindow(); } } }
protected override void Initialize() { #if IOS var bounds = UIKit.UIScreen.MainScreen.Bounds; var nativeScale = UIKit.UIScreen.MainScreen.Scale; var screenWidth = (int)(bounds.Width * nativeScale); var screenHeight = (int)(bounds.Height * nativeScale); graphics.PreferredBackBufferWidth = screenWidth; graphics.PreferredBackBufferHeight = screenHeight; #endif FlatRedBallServices.InitializeFlatRedBall(this, graphics); FlatRedBallServices.GraphicsOptions.TextureFilter = TextureFilter.Point; SpriteManager.OrderedSortType = SortType.ZSecondaryParentY; CameraSetup.SetupCamera(SpriteManager.Camera, graphics); GlobalContent.Initialize(); FlatRedBall.Screens.ScreenManager.Start(typeof(Teotihuacan.Screens.Level1)); base.Initialize(); }