public GamePage() { this.InitializeComponent(); // Create the game. var launchArguments = string.Empty; _game = MonoGame.Framework.XamlGame <NeonPartyGamesControllerGame> .Create(launchArguments, Window.Current.CoreWindow, swapChainPanel); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); Xamarin.Essentials.Platform.Init(this, bundle); this.MakeFullScreen(); NeonPartyGamesControllerGame.AndroidContext = this; var g = new NeonPartyGamesControllerGame(); g.ExitEvent += () => MoveTaskToBack(true); this.SetContentView((View)g.Services.GetService(typeof(View))); g.Run(); }
public NeonPartyGamesControllerGame() : base(1280, NeonPartyGamesControllerGame.ScreenHeight, 0, 0) { this.CanvasWidth = NeonPartyGamesControllerGame.GetScreenWidth(); this.BackgroundColor = Settings.BackgroundColor; this.Graphics.PreferredBackBufferWidth = this.CanvasWidth; this.Graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight; #if NETFX_CORE this.Graphics.SynchronizeWithVerticalRetrace = true; #else this.Graphics.SynchronizeWithVerticalRetrace = false; #endif this.IsFixedTimeStep = false; this.Content.RootDirectory = "Content"; #if ANDROID || IOS this.Graphics.IsFullScreen = true; #else #if DEBUG this.Graphics.IsFullScreen = false; #else this.Graphics.IsFullScreen = true; #endif #endif #if !ANDROID && !IOS && !PLAYSTATION4 this.Graphics.HardwareModeSwitch = false; this.IsMouseVisible = true; #endif #if NETFX_CORE Windows.UI.ViewManagement.ApplicationView.PreferredLaunchViewSize = new Windows.Foundation.Size(this.CanvasWidth, NeonPartyGamesControllerGame.ScreenHeight); Windows.UI.ViewManagement.ApplicationView.PreferredLaunchWindowingMode = Windows.UI.ViewManagement.ApplicationViewWindowingMode.PreferredLaunchViewSize; Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().FullScreenSystemOverlayMode = Windows.UI.ViewManagement.FullScreenSystemOverlayMode.Minimal; Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested += (object sender, Windows.UI.Core.BackRequestedEventArgs args) => { args.Handled = true; }; #endif #if !PLAYSTATION4 this.Window.AllowUserResizing = true; #endif this.Window.AllowAltF4 = true; }
static void Main() { using (var game = new NeonPartyGamesControllerGame()) game.Run(); }
internal static void RunGame() { game = new NeonPartyGamesControllerGame(); game.Run(); }