/// <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() { Font = Fonts.Ariel14Bold; ScreenManager = new ScreenManager(this); var splashScreen = new LogoScreen(); var menu = new MainMenuScreen(); var gameplay = new GameplayScreen(); var gameOver = new GameOverScreen(); var credits = new CreditsScreen(); if (DEV_MODE) { gameplay.Activate(); } else { splashScreen.Activate(); } ScreenManager.AddScreen(GameScreens.SplashScreen, splashScreen); ScreenManager.AddScreen(GameScreens.MainMenu, menu); ScreenManager.AddScreen(GameScreens.GamePlay, gameplay); ScreenManager.AddScreen(GameScreens.GameOver, gameOver); ScreenManager.AddScreen(GameScreens.Credits, credits); base.Initialize(); }
/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { this.DisplayInGame(); FMODUtil.System.update(); //Used to render things to a buffer that will have a zoom multiplier applied before rendering. SpriteBatch zoomBatch = new SpriteBatch(this.GraphicsDevice); RenderTarget2D target = new RenderTarget2D(this.GraphicsDevice, RenderingPipe.FullScreenWindow.Width, RenderingPipe.FullScreenWindow.Height); this.GraphicsDevice.SetRenderTarget(target); this.GraphicsDevice.Clear(Color.Black); if (Game1.SplashDone) { zoomBatch.Begin(); RenderingPipe.DrawScreen(zoomBatch); zoomBatch.End(); } else { int length = Game1.SplashScreens.Count; for (int i = 0; i < length; i++) { LogoScreen item = Game1.SplashScreens[i]; if (!item.Done()) { item.Draw(ref zoomBatch); break; } if (i == length - 1) { Game1.SplashDone = true; //Initialize main menu GUI.MainMenu.MainMenu.Initialize(); this.IsMouseVisible = true; } } } //set rendering back to the back buffer this.GraphicsDevice.SetRenderTarget(null); //render target to back buffer zoomBatch.Begin(); int width = (int)(this.GraphicsDevice.DisplayMode.Width * RenderingPipe.Zoom); int height = (int)(this.GraphicsDevice.DisplayMode.Height * RenderingPipe.Zoom); zoomBatch.Draw(target, new Rectangle(0, 0, width, height), Color.White); RenderingPipe.DrawGUI(zoomBatch); zoomBatch.End(); base.Draw(gameTime); }
public void desactiveAllScreen() { UIScreen.SetActive(false); GameOverScreen.SetActive(false); LogoScreen.SetActive(false); MenuScreen.SetActive(false); CronomeScreen.SetActive(false); creditScreen.SetActive(false); }
public static void ShowLogoScreen(this Game game, SpriteBatch spriteBatch) { var isTrial = Guide.IsTrialMode; game.CleanupComponents(); var logo_screen = new LogoScreen(game, () => { game.ShowMainMenu(); if (isTrial) game.Components.Add(new TrialComponent(game, spriteBatch, 120, "triangleshooter")); }, "Textures/vst_logo"); game.Components.Add(logo_screen); }
/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { float deltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds; this.DisplayInGame(); FMODUtil.Update(); //Used to render things to a buffer that will have a zoom multiplier applied before rendering. this.GraphicsDevice.Clear(Color.Black); if (Game1.SplashDone) { if (World.Dimensions.Count > 0) { //Never set this to SpriteSortMode.Texture, as that causes bugs. this.MapSpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, RenderInfo.Camera2D.TranslationMatrix); RenderingPipe.DrawScreen(this.MapSpriteBatch); this.MapSpriteBatch.End(); } this.GUIBatch.Begin(); RenderingPipe.DrawGUI(this.GUIBatch); this.GUIBatch.End(); } else { int length = Game1.SplashScreens.Count; for (int i = 0; i < length; i++) { LogoScreen item = Game1.SplashScreens[i]; if (!item.Done()) { item.Draw(this.MapSpriteBatch); break; } if (i == length - 1) { Game1.SplashDone = true; //Initialize main menu GUI.MainMenu.MainMenu.Initialize(); this.IsMouseVisible = true; } } } base.Draw(gameTime); }
/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { FMODUtil.System.update(); this.GraphicsDevice.SetRenderTarget(null); this.GraphicsDevice.Clear(Color.Black); if (Game1.SplashDone) { this.SpriteBatch.Begin(); RenderingPipe.DrawScreen(ref this.SpriteBatch); this.SpriteBatch.End(); } else { int length = Game1.SplashScreens.Count; for (int i = 0; i < length; i++) { LogoScreen item = Game1.SplashScreens[i]; if (!item.Done()) { item.Draw(ref this.SpriteBatch); break; } if (i == length - 1) { Game1.SplashDone = true; //Initialize main menu GUI.MainMenu.MainMenu.Initialize(); this.IsMouseVisible = true; } } } base.Draw(gameTime); }
static void Main(string [] args) { var screen = new LogoScreen(); screen.ShowLogo(); Console.Write($"Enter a value for x: "); string in1 = Console.ReadLine(); Console.Write($"Enter a value for y: "); string in2 = Console.ReadLine(); double x = Convert.ToDouble(in1); double y = Convert.ToDouble(in2); double result = (x + y) / 2; Console.ForegroundColor = ConsoleColor.Yellow; Console.Write("Hey buddy, what's your name?: "); var user = Console.ReadLine(); screen.ShowLogo(); Console.ResetColor(); Console.WriteLine(value: $"{user} your average is: {result:N1}"); }
private void showLogoScreen() { logoScreen = new LogoScreen(lhg); lhg.MyScreenManager.AddScreen(logoScreen); mode = GameMode.Logo; }