/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { GraphicsWidth = GraphicsDevice.Viewport.Width; GraphicsHeight = GraphicsDevice.Viewport.Height; ApplyGraphicsSettings(); ConvertUnits.SetDisplayUnitToSimUnitRatio(Physics.DisplayToSimRation); spriteBatch = new SpriteBatch(GraphicsDevice); TextureLoader.Init(GraphicsDevice); //do this here because we need it for the loading screen WaterRenderer.Instance = new WaterRenderer(base.GraphicsDevice, Content); Quad.Init(GraphicsDevice); loadingScreenOpen = true; TitleScreen = new LoadingScreen(GraphicsDevice) { WaitForLanguageSelection = Config.ShowLanguageSelectionPrompt }; bool canLoadInSeparateThread = true; loadingCoroutine = CoroutineManager.StartCoroutine(Load(canLoadInSeparateThread), "Load", canLoadInSeparateThread); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { GraphicsWidth = GraphicsDevice.Viewport.Width; GraphicsHeight = GraphicsDevice.Viewport.Height; ConvertUnits.SetDisplayUnitToSimUnitRatio(Physics.DisplayToSimRation); spriteBatch = new SpriteBatch(GraphicsDevice); TextureLoader.Init(GraphicsDevice); loadingScreenOpen = true; TitleScreen = new LoadingScreen(GraphicsDevice); GameMain.NilMod.FetchExternalIP(); if (GameMain.NilMod.StartToServer) { LoadingScreen.loadType = LoadType.Server; LoadingScreen.ServerName = GameMain.NilMod.ServerName; LoadingScreen.ServerPort = GameMain.NilMod.ServerPort.ToString(); LoadingScreen.PublicServer = GameMain.NilMod.PublicServer; LoadingScreen.MaxPlayers = GameMain.NilMod.MaxPlayers.ToString(); LoadingScreen.Password = GameMain.NilMod.UseServerPassword ? GameMain.NilMod.ServerPassword : ""; } else { LoadingScreen.loadType = LoadType.Mainmenu; } loadingCoroutine = CoroutineManager.StartCoroutine(Load()); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { GraphicsWidth = GraphicsDevice.Viewport.Width; GraphicsHeight = GraphicsDevice.Viewport.Height; Sound.Init(); ConvertUnits.SetDisplayUnitToSimUnitRatio(Physics.DisplayToSimRation); spriteBatch = new SpriteBatch(GraphicsDevice); TextureLoader.Init(GraphicsDevice); loadingScreenOpen = true; TitleScreen = new LoadingScreen(GraphicsDevice); loadingCoroutine = CoroutineManager.StartCoroutine(Load()); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { GraphicsWidth = GraphicsDevice.Viewport.Width; GraphicsHeight = GraphicsDevice.Viewport.Height; ConvertUnits.SetDisplayUnitToSimUnitRatio(Physics.DisplayToSimRation); spriteBatch = new SpriteBatch(GraphicsDevice); TextureLoader.Init(GraphicsDevice); loadingScreenOpen = true; TitleScreen = new LoadingScreen(GraphicsDevice); loadingCoroutine = CoroutineManager.StartCoroutine(Load()); var myForm = (System.Windows.Forms.Form)System.Windows.Forms.Form.FromHandle(Window.Handle); myForm.Deactivate += new EventHandler(HandleDefocus); myForm.Activated += new EventHandler(HandleFocus); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { GraphicsWidth = GraphicsDevice.Viewport.Width; GraphicsHeight = GraphicsDevice.Viewport.Height; ConvertUnits.SetDisplayUnitToSimUnitRatio(Physics.DisplayToSimRation); spriteBatch = new SpriteBatch(GraphicsDevice); TextureLoader.Init(GraphicsDevice); loadingScreenOpen = true; TitleScreen = new LoadingScreen(GraphicsDevice); bool canLoadInSeparateThread = false; #if WINDOWS canLoadInSeparateThread = true; #endif loadingCoroutine = CoroutineManager.StartCoroutine(Load(), "", canLoadInSeparateThread); }